RAD Studio
ContentsIndex
PreviousUpNext
float.h

The following functions, macros, and classes are provided in float.h:

Name 
Description 
Header File
float.h
Description
Default control word for 80x87 math coprocessor. 
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.
Portability  
Header File
float.h
Category
Math Routines
Prototype
unsigned int _clear87 (void);
unsigned int _clearfp (void);
Description
Clears the floating-point status word.
_clear87 clears the floating-point status word, which is a combination of the 80x87 status word and other conditions detected by the 80x87 exception handler.
_clearfp is identical to _clear87 and is for Microsoft compatibility.
Return Value
The bits in the value returned indicate the floating-point status before it was cleared. For information on the status word, refer to the constants defined in float.h.
Example  
Header File
float.h
Category
Math Routines
Prototype
unsigned int _control87(unsigned int newcw, unsigned int mask);
unsigned int _controlfp(unsigned int newcw, unsigned int mask);
Description
Manipulates the floating-point control word.
_control87 retrieves or changes the floating-point control word.
The floating-point control word is an unsigned int that, bit by bit, specifies certain modes in the floating-point package; namely, the precision, infinity, and rounding modes. Changing these modes lets you mask or unmask floating-point exceptions.
_control87 matches the bits in mask to the bits in newcw. If a mask bit equals 1, the corresponding bit in newcw contains the new value... more 
Header File
float.h
Category
Math Routines
Prototype
double _copysign(double da, double db);
long double _copysignl(long double lda, long double ldb);
Description
Returns the double-precision floating point argument da, with the same sign as the double-precision floating-point argument db.
_copysignl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns the first value with the same magnitude and exponent, but with the sign of the second value. There is no error value returned.
Portability  
Header File
float.h
Category
Math Routines
Prototype
int _finite(double d);
int _finitel(long double ld);
Description
Determines whether a given double-precision floating point value d is finite.
_finitel is the long double version; it takes a long double argument.
Return Value
Returns non-zero if the argument is finite, and 0 if it is not.
Portability  
Header File
float.h
Category
Math Routines
Prototype
int _fpclass(double d);
int _fpclassl(long double ld);
Description
Returns an integer value representing the type (class) of an IEEE real for doubles. This value contains information on the floating-point class of the argument.
_fpclassl is the long double version; it takes a long double argument and returns the type (class) of an IEEE real for long doubles.
Return Value
Returns an integer value that indicates the floating-point class of its argument. The possible values, which are listed in the table below, are defined in FLOAT.H.
Portability  
Header File
float.h
Category
Math Routines
Prototype
void _fpreset(void);
Description
Reinitializes floating-point math package.
_fpreset reinitializes the floating-point math package. This function is usually used in conjunction with system or the exec... or spawn... functions. It is also used to recover from floating-point errors before calling longjmp.
Note: If an 80x87 coprocessor is used in a program a child process (executed by the system, or by an exec... or spawn... function) might alter the parent process' floating-point state.
  • If you use an 80x87 take the following precautions:
  • Do not call system or an exec... or spawn... function while a... more 
Header File
float.h
Category
Classification Routines, Math Routines
Prototype
int _isnan(double d);
int _isnanl(long double ld);
Description
Tests whether a given double-precision floating-point value d is a NaN.
_isnanl is the long double version; it takes a long double argument.
Return Value
Returns a nonzero value (TRUE) if the value passed in is a NaN; otherwise it returns 0 (FALSE). The non-zero return value corresponds to either _FPCLASS_SNAN, if the NaN is of the signaling type, or _FPCLASS_QNAN, if the NaN is of the quiet type. The values for _FPCLASS_SNAN and _FPCLASS_QNAN are in float.h.
Portability  
Header File
float.h
Category
Math Routines
Prototype
double _logb(double d);
long double _logbl(long double ld);
Description
Extracts the exponential value of a double-precision floating-point argument. If the argument is denormalized, it is treated as if it were normalized.
_logbl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns the unbiased exponent of the value passed in.
Portability  
Header File
float.h
Category
Math Routines
Prototype
double _nextafter(double da, double db);
long double _nextafterl(long double lda, long double ldb);
Description
Takes two doubles (da and db) and returns the closest representable neighbor of da in the direction toward db.
If da == db, _nextafter returns da, with no exception triggered. If either da or db is a quiet NaN, then the return value is one or the other of the input NaNs.
_nextafterl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns the closest representable neighbor of... more 
Header File
float.h
Category
Math Routines
Prototype
double _scalb(double d, long exp);
long double _scalbl(long double ld, long exp);
Description
Scales the argument d by a power of 2.
_scalbl is the long double version; it takes a long double argument and returns a long double result.
Return Value
Returns an exponential value if successful. On overflow (depending on the sign of the argument), the function returns +/– HUGE_VAL; the ERRNO variable is set to ERANGE.
Portability  
Header File
float.h
Category
Math Routines
Prototype
unsigned int _status87(void);
unsigned int _statusfp(void);
Description
Gets floating-point status.
_status87 gets the floating-point status word, which is a combination of the 80x87 status word and other conditions detected by the 80x87 exception handler.
_statusfp is identical to _status87 and is for Microsoft compatibility.
Return Value
The bits in the return value give the floating-point status. See float.h for a complete definition of the bits returned by _status87 and _status87.
Portability  
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!