Function signBit
Determines whether the sign bit of x is set or not.
bool signBit(F)
(
F x
)
if (isFloatingPoint!F);
If the sign bit, x is a negative number, otherwise positive.
Parameters
Name | Description |
---|---|
F | Type of the floating point number. |
x | Floating point number. |
Returns
true if the sign bit of x is set, false otherwise.
Example
assert(signBit(-1.0f));
assert(!signBit(1.0f));
assert(signBit(-1.0));
assert(!signBit(1.0));
assert(signBit(-1.0L));
assert(!signBit(1.0L));