1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

c.lib 1.169 (8.8.2004)

- Since the 'long double' data type is not really supported by the GCC
  versions we use (and not supported by SAS/C either) building the
  library with support code for it is now a configurable option. Unless
  enabled, 'long double' is now treated like 'double'.

- Reworked the HUGE_VAL definition which previously would default to
  Infinity. The new code properly defines this to the largest
  representable floating point number. The 'great' thing about the
  HUGE_VAL definition in this library is that it's a reference to
  a binary constant initialized by the library startup code. So any
  application checking for HUGE_VAL merely needs to be relinked
  rather than recompiled.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14703 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2004-08-08 10:55:57 +00:00
parent 0a3962a105
commit 3f284b7fb8
24 changed files with 145 additions and 141 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: math_isnan.c,v 1.1 2004-08-07 09:15:32 obarthel Exp $
* $Id: math_isnan.c,v 1.2 2004-08-08 10:55:57 obarthel Exp $
*
* :ts=4
*
@ -45,26 +45,6 @@
/****************************************************************************/
union ieee_long_double
{
long double value;
unsigned long raw[3];
};
union ieee_double
{
double value;
unsigned long raw[2];
};
union ieee_single
{
float value;
unsigned long raw[1];
};
/****************************************************************************/
int
isnan(double number)
{
@ -92,15 +72,17 @@ isnan(double number)
/* Exponent = 2047 and fraction != 0.0 */
result = (((x.raw[0] & 0x7FF00000) == 0x7FF00000) && ((x.raw[0] & 0x000FFFFF) != 0 || (x.raw[1] != 0)));
}
#if defined(USE_LONG_DOUBLE)
else if (sizeof(number) == 12) /* extended precision */
{
union ieee_long_double x;
x.value = number;
/* Exponent = 32767 and fraction != 0.0 */
/* Exponent = 32766 and fraction != 0.0 */
result = (((x.raw[0] & 0x7FFF0000) == 0x7FFF0000) && ((x.raw[1] & 0x7FFFFFFF) != 0 || x.raw[2] != 0));
}
#endif /* USE_LONG_DOUBLE */
else
{
/* Can't happen */