COPYSIGN 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

copysignf, copysign, copysignl, copysignw, copysignq, copysignll, copysigndf, copysignd, copysigndl, copysigndll - number sign manipulation function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float copysignf (float x, float y);

extern double copysign (double x, double y);

extern long double copysignl (long double x, long double y);

extern __float80 copysignw (__float80 x, __float80 y);

extern __float128 copysignq (__float128 x, __float128 y);

extern long_long_double copysignll (long_long_double x, long_long_double y);

extern decimal_float copysigndf (decimal_float x, decimal_float y);

extern decimal_double copysignd (decimal_double x, decimal_double y);

extern decimal_long_double copysigndl (decimal_long_double x, decimal_long_double y);

extern decimal_long_long_double copysigndll (decimal_long_long_double x, decimal_long_long_double y);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Copy the sign of y to a value with the magnitude of x. Either argument may be a NaN or Infinity, and no floating-point exception can be raised if they are.

Caution: The sign of a NaN is platform dependent, but that is not significant in the IEEE 754 arithmetic system.


RETURN VALUES

The return value is the magnitude of the first argument with the sign of the second argument. No other part of the floating-point value is modified, so in particular, if x is a NaN, all significand bits are preserved. On some systems, the significand records information about the origin of the NaN, or whether it is a signaling NaN or a quiet NaN.

ERRORS

None.

SEE ALSO

signbit(3CW).