MicrOS
copysignf.c File Reference
#include "../math.h"

Functions

float copysignf (float x, float y)
 Copy sign. More...
 

Function Documentation

◆ copysignf()

float copysignf ( float  x,
float  y 
)

Copy sign.

The copysignf functions produce a value with the magnitude of x and the sign of y. They produce a NaN (with the sign of y) if x is a NaN. On implementations that represent a signed zero but do not treat negative zero consistently in arithmetic operations, the copysign functions regard the sign of zero as positive.

Parameters
xValue with the magnitude of the resulting value.
yValue with the sign of the resulting value.
Returns
The copysignf functions return a value with the magnitude of x and the sign of y.