Math.copySign : Floating Point Number « JDK 6 « Java






Math.copySign

 

public class FloastPointDemo {
  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);
  }
}

// Math.copySign (1234.56, -1) = -1234.56

        








Related examples in the same category

1.Math.scalb
2.Math.getExponent
3.Math.nextAfter
4.Math.nextUp