withSign

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

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
(Common source) (JVM source) (JS source) (Native source)
fun Float.withSign(sign: Int): Float
(Common source) (JVM source) (JS source) (Native source)

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