>>>> In
<13663.35921.908780.615253(a)lasker.worley.com>
>>>> Martin Buchholz <martin(a)xemacs.org> wrote:
Yes. XEmacs assumes an ANSI-C environment, and all the above values
can be expected to exist, even without a configure test. So all these
values should be accessed using C, and exported to lisp where
necessary.
most-positive-float equals to DBL_MAX
most-negative-float equals to -DBL_MAX
least-positive-normalized-float equals to DBL_MIN
least-negative-normalized-float equals to -DBL_MIN
float-epsilon equals to DBL_EPSILON
float-epsilon and float-negative-epsilon can be safely calculated in
temacs.
We cannot set least-positive-float and least-negative-float from <float.h>
constants in the portable manner.
The following C program do the similar thing to cl-float-limits in
calculating least-positive-float, and can generate a C header file.
--
SAKIYAMA Nobuo nobuo(a)db3.so-net.or.jp
#include <stdio.h>
#include <float.h>
#include <signal.h>
void dummy() {
}
main () {
double x, y;
signal(SIGFPE,SIG_IGN);
x = DBL_MIN;
while(x > 0.0){
y = x;
dummy();
x/= 2.0;
}
printf("#define LEAST_POSITIVE_FLOAT %.*e\n",DBL_DIG, y);
}