Here you can find the source of copySign(final double x, final double y)
public static final double copySign(final double x, final double y)
//package com.java2s; public class Main { public static final double copySign(final double x, final double y) { //__HI(x) = (__HI(x)&0x7fffffff)|(__HI(y)&0x80000000); // The below is actually about 30% faster than doing greater/less comparisons. return Double.longBitsToDouble((Double.doubleToLongBits(x) & 0x7fffffffffffffffL) | (Double.doubleToLongBits(y) & 0x8000000000000000L)); }//from w w w . j a v a2 s . co m /** * Please update your code to use copySign * @param x * @param y * @return copySign(x,y) * @deprecated Please update your code to use copySign */ public static final double copysign(final double x, final double y) { return copySign(x, y); } }