Contents|Index|Previous|Next

copysign, copysignf
[sign of y, magnitude of x]

SYNOPSIS

    #include <math.h>
    double copysign (double x, double y);
    float copysignf (float x, float y);

DESCRIPTION

copysign constructs a number with the magnitude (absolute value) of its first argument, x, and the sign of its second argument, y.

copysignf does the same thing; the two functions differ only in the type of their arguments and result.

RETURNS

copysign returns a double with the magnitude of x and the sign of y. copysignf returns a float with the magnitude of x and the sign of y.

COMPLIANCE

copysign is not required by either ANSI C or the System V Interface Definition (Issue 2).