Re: HIGHEST-ALGEBRAIC and LOWEST-ALGEBRAIC (was: Re: Dynamically ...)




"Roger While" <simrw@xxxxxxxxxxxx> wrote in message
news:eubes7$181$03$1@xxxxxxxxxxxxxxxxxxxx
Is float.h a POSIX standard ?

I don't know! However, it is in standard C (ISO 9899:1990).

Where FLT_MAX, DBL_MAX, and LDBL_MAX are
present they are defined as, at least, 1E+37 for all sizes
and the implementor of the C compiler is required to
support floating-point to this limit to be conforming.

And when not defined on a particular mc
what then ?

A COBOL implementation need not support floating-point.

Page 696, FDIS 19892002, B.3 Processor-dependent
language element list, ...

"5) The usages FLOAT-SHORT, FLOAT-LONG, and
FLOAT-EXTENDED are dependent upon the availability
of a suitable computer architecture for floating-point data
formats."

If "not defined on a particular mc" means "not available",
then the usages need not be implemented.


"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 */



.