COPYSIGN(3) NetBSD Library Functions Manual COPYSIGN(3)NAME

copysign,copysignf,copysignl-- functions to manipulate signsLIBRARY

Math Library (libm, -lm)SYNOPSIS

#include <math.h>doublecopysign(double x,double y);floatcopysignf(float x,float y);long doublecopysignl(long double x,long double y);#include <tgmath.h>real-floatingcopysign(real-floating x,real-floating y);DESCRIPTION

Thecopysign(),copysignf(), andcopysignl() functions return a value whose absolute value matchesx, but whose sign bit is taken fromy.RETURN VALUES

Upon successful completion, all three functions return a value with the magnitude ofxand the sign ofy. IfxisNaN, the functions return aNaNwith the sign ofy.SEE ALSO

math(3), signbit(3)STANDARDS

The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').CAVEATS

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 9.2 September 28, 2017 NetBSD 9.2

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.