- NetBSD Manual Pages
COPYSIGN(3) NetBSD Library Functions Manual COPYSIGN(3)
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
copysign, copysignf, copysignl -- functions to manipulate signs
Math Library (libm, -lm)
copysign(double x, double y);
copysignf(float x, float y);
copysignl(long double x, long double y);
copysign(real-floating x, real-floating y);
The copysign(), copysignf(), and copysignl() functions return a value
whose absolute value matches x, but whose sign bit is taken from y.
Upon successful completion, all three functions return a value with the
magnitude of x and the sign of y. If x is NaN , the functions return a
NaN with the sign of y.
The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').
Note that on implementations that represent a signed zero but do not
treat negative zero consistently in arithmetic operations, these func-
tions may regard the sign of zero as positive.
NetBSD 10.99 September 28, 2017 NetBSD 10.99