code: public static float copySign(float magnitude, float sign) {
          return Float.intBitsToFloat((Float.floatToRawIntBits(sign) &
                                       (FloatConsts.SIGN_BIT_MASK)) |
                                      (Float.floatToRawIntBits(magnitude) &
                                       (FloatConsts.EXP_BIT_MASK |
                                        FloatConsts.SIGNIF_BIT_MASK)));
      }
docs: Returns the first floating-point argument with the sign of the
  second floating-point argument.  Note that unlike the {@link
  StrictMath#copySign(float, float) StrictMath.copySign}
  method, this method does not require NaN {@code sign}
  arguments to be treated as positive values; implementations are
  permitted to treat some NaN arguments as positive and other NaN
  arguments as negative to allow greater performance.
  
  @param magnitude  the parameter providing the magnitude of the result
  @param sign   the parameter providing the sign of the result
  @return a value with the magnitude of {@code magnitude}
  and the sign of {@code sign}.
  @since 1.6