Math: copySign(double magnitude, double sign)
public class Main {
public static void main(String[] args) {
// Returns a copySign of the first argument
double d = Math.copySign (1234.56, -1);
System.out.println ("Math.copySign (1234.56, -1) = " + d);
}
}
Related examples in the same category