Online Java Compiler By
JavaTpoint.com
public class CopySignExample3 { public static void main(String[] args) { float x = -788.63f; float y = 26.9f; // return -26.9 because second argument x is negative System.out.println(Math.copySign(y, x)); } }
Output