finding absolute value in java
import java.lang.Math;
int sum,x=-5;
sum = Math.abs(x);
finding absolute value in java
import java.lang.Math;
int sum,x=-5;
sum = Math.abs(x);
abs in java
public class Test {
public static void main(String args[]) {
Integer a = -8;
double d = -100;
float f = -90;
System.out.println(Math.abs(a));
System.out.println(Math.abs(d));
System.out.println(Math.abs(f));
}
}
math.absolute java
float a = 123.0f;
System.out.println(Math.abs(a)); //123.0
double d = -999.3456;
System.out.println(Math.abs(d)); //999.3456
int e = -123;
System.out.println(Math.abs(g)); //123
long g = -12345678;
System.out.println(Math.abs(g)); //12345678
maths.abs function in java
abs() - absolute value ,used to return absolute value
maths.abs function in java
public static DataType abs(DataType a)
a : the argument whose absolute value is to be determined
Returns : This method returns the absolute value of the argument.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us