Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- From: "Roger While" <simrw@xxxxxxxxxxxx>
- Date: Tue, 27 Mar 2007 17:56:49 +0200
Is float.h a POSIX standard ?
And when not defined on a particular mc
what then ?
"Rick Smith" <ricksmith@xxxxxxx> schrieb im Newsbeitrag
news:130i39dj89ohrb2@xxxxxxxxxxxxxxxxxxxxx
"Roger While" <simrw@xxxxxxxxxxxx> wrote in message
news:euahkq$2ig$02$1@xxxxxxxxxxxxxxxxxxxx
I know that FLOAT-xxx are implementor defined but I wonder
what these functions should return for FLOAT-xxx fields and how
to programatically achieve this.
For an underlying C or C++ implementation, ...
-----
#include <float.h>
float highest_algebraic_float_short () {
return (FLT_MAX);
}
float lowest_algebraic_float_short () {
return (-FLT_MAX);
}
double highest_algebraic_float_long () {
return (DBL_MAX);
}
double lowest_algebraic_float_long () {
return (-DBL_MAX);
}
long double highest_algebraic_float_extended () {
return (LDBL_MAX);
}
long double lowest_algebraic_float_extended () {
return (-LDBL_MAX);
}
-----
Or something like this, should do it.
Values from Microsoft Visual C++ 5.0 are:
#define FLT_MAX 3.402823466e+38F /* max value */
#define DBL_MAX 1.7976931348623158e+308 /* max value */
#define LDBL_MAX 1.189731495357231765e+4932L /* max value */
.
- Follow-Ups:
- References:
- Dynamically Determine Numeric PICTURE String
- From: Rick Smith
- Re: Dynamically Determine Numeric PICTURE String
- From: William M. Klein
- Re: Dynamically Determine Numeric PICTURE String
- From: Rick Smith
- Re: Dynamically Determine Numeric PICTURE String
- From: Roger While
- HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- From: Rick Smith
- Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- From: Roger While
- Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- From: Rick Smith
- Dynamically Determine Numeric PICTURE String
- Prev by Date: Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- Next by Date: Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- Previous by thread: Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- Next by thread: Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)
- Index(es):