Online Java Compiler By
JavaTpoint.com
public class CopySignExample2 { public static void main(String[] args) { double x = -580.73; double y = 26.3; // return 580.73 because second argument y is positive System.out.println(Math.copySign(x, y)); } }
Output