withSign

Common
JVM
JS
Native
1.2
fun Double.withSign(sign: Double): Double
fun Float.withSign(sign: Float): Float

Returns this value with the sign bit same as of the sign value.

If sign is NaN the sign of the result is undefined.

Common
JVM
JS
Native
1.2
fun Double.withSign(sign: Int): Double
fun Float.withSign(sign: Int): Float

Returns this value with the sign bit same as of the sign value.