mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Added NAN, INFINITY, FLT_EVAL_METHOD, float_t and double_t to
<math.h>. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14959 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -45,6 +45,9 @@
|
||||
negative and not EOF, the result was identical to the input, which
|
||||
could have had negative side-effects.
|
||||
|
||||
-<2D>Added NAN, INFINITY, FLT_EVAL_METHOD, float_t and double_t to
|
||||
<math.h>.
|
||||
|
||||
|
||||
c.lib 1.192 (12.5.2005)
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math.h,v 1.10 2005-05-19 13:57:53 obarthel Exp $
|
||||
* $Id: math.h,v 1.11 2005-05-29 10:09:55 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -129,6 +129,16 @@ extern float __huge_val_float;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float __infinity;
|
||||
extern float __nan;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define INFINITY ((const float)__infinity)
|
||||
#define NAN ((const float)__nan)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define FP_INFINITE 0 /* -/+ infinity */
|
||||
#define FP_NAN 1 /* not a number */
|
||||
#define FP_NORMAL 2 /* normalized floating point number */
|
||||
@ -233,6 +243,15 @@ extern float copysignf(float x, float y);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define FLT_EVAL_METHOD 0
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef float float_t;
|
||||
typedef double double_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math_init_exit.c,v 1.16 2005-05-07 17:03:55 obarthel Exp $
|
||||
* $Id: math_init_exit.c,v 1.17 2005-05-29 10:09:54 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -73,6 +73,11 @@ struct Library * MathIeeeDoubTransBase;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float __infinity;
|
||||
float __nan;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float __huge_val_float;
|
||||
double __huge_val;
|
||||
|
||||
@ -189,6 +194,13 @@ MATH_CONSTRUCTOR(math_init)
|
||||
}
|
||||
#endif /* USE_LONG_DOUBLE */
|
||||
|
||||
/* Finally, fill in the constants behind INFINITY and NAN. */
|
||||
single_x = (union ieee_single *)&__infinity;
|
||||
single_x->raw[0] = 0x7f800000;
|
||||
|
||||
single_x = (union ieee_single *)&__nan;
|
||||
single_x->raw[0] = 0x7fc00001;
|
||||
|
||||
success = TRUE;
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user