Item Value
Header filemath.h
Declarationfloat copysignf(float val, float signval);double copysign(double val, double signval);long double copysignl(long double val, long double signval);
Functiongives val the same sign as signval, and return the result.
#include
#include
int main(void)
{
printf("%f", copysignf(1.0, -2.0));
}
-1.000000