Perform number manipulation.
#include <math.h>
double copysign (x, y)
double x, double y;
float copysignf (x, y)
float x, float y;
long double copysignl (x, y)
long double x, long double y;
_Decimal32 copysignd32(x, y)
_Decimal32 x;
_Decimal32 y;
_Decimal64 copysignd64(x, y)
_Decimal64 x;
_Decimal64 y;
_Decimal128 copysignd128(x, y)
_Decimal128 x;
_Decimal128 y;
The copysign, copysignf, copysignl, copysignd32, copysignd64, and copysignd128 subroutines produce a value with the magnitude of x and the sign of y.
Item | Description |
---|---|
x | Specifies the magnitude. |
y | Specifies the sign. |
Upon successful completion, the copysign, copysignf, copysignl, copysignd32, copysignd64, and copysignd128 subroutines return a value with a magnitude of x and a sign of y.