_chgsign, _chgsignl

De RAD Studio
Aller à : navigation, rechercher

Remonter à float.h - Index



Header File

float.h

Category

Math Routintes

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.

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;
}

Portability

POSIX Win32 ANSI C ANSI C++

_chgsign

+

_chgsignl

+