+ 2
Who knows about Math.abs()? give me the outputs :
Math.abs('-1'); Math.abs(-2); Math.abs(null); Math.abs(''); Math.abs([]); Math.abs([2]); Math.abs([1,2]); Math.abs({}); Math.abs('string');
5 odpowiedzi
+ 6
In Java:-
Math.abs() function returns the absolute value of the number passed as argument i.e. either you enter a positive number or a negative number, it will always return a positive number...
e.g.
Math.abs(4) -> 4
Math.abs(-4) -> 4
Math.abs() takes only int,long,float and double as argument
+ 6
@Prem Singh Rathore
This was not a C++ question. Therefore I request you to remove the c++ tag as that is misleading...
+ 5
@prem_singh .......thanks bro..:D
+ 3
Very well explained..
+ 1
@Kinshuk did it bro... appreciate it.