Implementation status: to be implemented


#include <math.h>

double copysign(double x, double y);
float copysignf(float x, float y);
long double copysignl(long double x, long double y);


The functions compute the value with the magnitude of x and the sign of y.

x - a number whose magnitude is taken into account.
y - a number whose sign is taken into account.

Return value

These functions return the value with the magnitude of x. The value has the sign of y.


No errors are defined.

Implementation tasks

  • Implement the functions: copysign(), copysignf() and copysignl().