_chgsign, _chgsignl
Go Up to float.h Index
Header File
float.h
Prototype
double _chgsign(double d);
long double _chgsignl(long double ld);
Description
Reverses the sign of a double-precision floating-point argument, d.
_chgsignl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns a value of the same magnitude and exponent as the argument, but with the opposite sign. There is no error return value.
Portability
POSIX | ANSI C | ANSI C++ | Win32 | Win64 | OS X | |
---|---|---|---|---|---|---|
_chgsign | + | |||||
_chgsignl | + |
Example
#include <float.h>
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[]) {
double number;
printf("Enter a double value: ");
scanf("%lf", &number);
printf("Value with the chnaged sign is: %lf\n", '' '_chgsign' ''(number));
return 0;
}