copysign

Copies the sign-bit from one value to another.

@safe pure @safe @nogc nothrow pure
T
copysign
(
T
)
(
T to
,)
if (
__traits(isScalar, T)
)

Parameters

to T

The value to copy to

from T

The value to copy from

Return Value

Type: T

The value of to with the sign bit flipped to match from.

Meta