std::signbit

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

int signbit( float arg );
(C++11 feature)
int signbit( double arg );
(C++11 feature)
int signbit( long double arg );
(C++11 feature)


Determines if the given floating point number arg is negative.

[edit] Parameters

arg - floating point value

[edit] Return value

nonzero value if arg is negative, 0 otherwise

[edit] See also

abs(float)
fabs
absolute value of an absolute value of an floating point value (|x|)
(function)
copysign (C++11)
copies the sign of a floating point value
(function)