From: Rigo Schultz <schultz@eva.mpg.de>
Subject: floating point problem
Date: Thu, 19 Jun 2003 18:32:33 +0200 [thread overview]
Message-ID: <bcsoj1$mmclr$1@fu-berlin.de> (raw)
I try to run some simulations at different hardware architectures, ALPHA
EV6 and x86. Both runnig Linux.
But I get Floating Point Exceptions at the Alpha system.
It seems that the "float" and "double" range on EV6 are different to the
x86 systems. Sorry, I'm not familar with that stuff.
Here is a short c-source, that shows the difference. But I do'nt
understand why the Alpha breaks too early.
Thanks Rigo
#include <stdio.h>
int main(void)
{
enum {N = 150};
int i;
float under = 1.0; /* for underflow */
float over = 1.0; /* for overflow */
printf ("sizeof(int) = %d\n", sizeof(int));
printf ("sizeof(float) = %d\n", sizeof(float));
printf ("sizeof(double) = %d\n", sizeof(double));
printf ("sizeof(long double) = %d\n", sizeof(long double));
printf ("\n\n");
printf("\t i under over \n");
printf("\t--------------------------------\n");
for (i = 1; i <= N; ++i) {
under /= 2.0;
over *= 2.0;
printf("\t %d %e %e\n", i, under, over);
}
return (0);
}
next reply other threads:[~2003-06-19 16:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-19 16:32 Rigo Schultz [this message]
2003-06-19 16:39 ` floating point problem Falk Hueffner
2003-06-19 18:42 ` Robert M. Riches Jr
2003-06-20 7:36 ` Rigo Schultz
2003-06-20 7:53 ` Falk Hueffner
2003-06-20 8:25 ` Rigo Schultz
-- strict thread matches above, loose matches on Subject: below --
2003-06-19 18:32 Rigo Schultz
2003-06-19 18:32 Rigo Schultz
2003-06-19 18:39 Falk Hueffner
2003-06-19 18:39 Falk Hueffner
2003-06-19 18:42 Robert M. Riches Jr
2003-06-19 18:42 Robert M. Riches Jr
2003-06-20 9:36 Rigo Schultz
2003-06-20 9:53 Falk Hueffner
2003-06-20 10:25 Rigo Schultz
2003-06-20 10:25 Rigo Schultz
2003-06-21 9:31 Falk Hueffner
2003-06-21 9:31 Rigo Schultz
2003-06-23 7:00 Falk Hueffner
2003-06-23 7:00 Rigo Schultz
2003-06-24 3:23 Falk Hueffner
2003-06-24 3:23 Rigo Schultz
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox