From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,47f79c0da38c8a0,start X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2003-06-19 09:32:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!magellan.eva.mpg.DE!not-for-mail From: Rigo Schultz Newsgroups: comp.os.linux.alpha Subject: floating point problem Date: Thu, 19 Jun 2003 18:32:33 +0200 Message-ID: NNTP-Posting-Host: magellan.eva.mpg.de (194.94.96.194) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1056040353 23802555 194.94.96.194 (16 812) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en Xref: archiver1.google.com comp.os.linux.alpha:7759 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 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); }