This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
DBL_MIN on egcs-1.0.3a alphaev56-dev-linux-gnu
- To: egcs-bugs at cygnus dot com
- Subject: DBL_MIN on egcs-1.0.3a alphaev56-dev-linux-gnu
- From: Rob Whitehurst <rob at physics dot unimelb dot EDU dot AU>
- Date: Thu, 11 Jun 1998 16:14:07 +1000 (EST)
The following code causes problems with egcs-1.0.3a on an alpha;
#include <float.h>
#include <stdio.h>
#define DBL_TWO 2.2250738585072018772E-308
int main() {
double one = 1.0,
jollySmall = DBL_MIN,
justSmall = DBL_TWO;
printf("A jolly small number is %.20G\n"
"Not quite so small is %.20G\n", jollySmall, justSmall);
fflush(stdout);
return (one < jollySmall);
}
The output from gdb-4.17 is as follows;
This GDB was configured as "alphaev56-unknown-linux-gnu"...
(gdb) r
Starting program: /home/rob/Lagrange/Reflexion/small
A jolly small number is 2.225073858507200889E-308
Not quite so small is 2.2250738585072018772E-308
Program received signal SIGFPE, Arithmetic exception.
0x1200007ec in main () at small.c:14
14 return (one < jollySmall);
(gdb) p one < jollySmall
Erroneous arithmetic operation.
(gdb) p one < justSmall
$1 = 0
(gdb)
Compiled with -mieee it doesn't dump core but the value
reported for the variable jollySmall is still wrong and beneath
the value of DBL_MIN recorded in float.h: (and gdb still grumbles)
(gdb) r
Starting program: /home/rob/Lagrange/Reflexion/small
A jolly small number is 2.225073858507200889E-308
Not quite so small is 2.2250738585072018772E-308
Breakpoint 1, main () at small.c:14
14 return (one < jollySmall);
(gdb) p one < jollySmall
Erroneous arithmetic operation.
(gdb) c
Continuing.
Program exited normally.
(gdb)
Anybody know what is going on here?
Rob Whitehurst