`copysign`

, `copysignf`

---sign of #include <math.h> double copysign (doublex, doubley); float copysignf (floatx, floaty);

**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`.

**Portability**

`copysign`

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

Go to the first, previous, next, last section, table of contents.