From: andi@complang.tuwien.ac.at (Andreas Krall)
Subject: Re: Why does this code dont work on Alpha?
Date: 2000/01/05 [thread overview]
Message-ID: <84ve9c$dph$1@news.tuwien.ac.at> (raw)
In-Reply-To: 84vbos$v43$1@inet-1.pnu.com
In article <84vbos$v43$1@inet-1.pnu.com>,
Pete <pete@no-spam.net> writes:
> I wonder why I get
> Floating point exception (core dumped)
> then I run this very simple C code?
>
...
> for (i=0;i<1000000000;i++)
> x=x*x;
...
You get a floating point exception because the result of your computation
is to big to be represented as a floating point number (3.14^2^100000000).
If you want to do floating point coumputations with infinities you have to
compile your program with the option -ieee. Your result will then be a
positive infinity.
--
andi@complang.tuwien.ac.at Andreas Krall
http://www.complang.tuwien.ac.at/andi/ Inst. f. Computersprachen, TU Wien
tel: (+431) 58801/18511 Argentinierstr. 8/4/1851
fax: (+431) 58801/18598 A-1040 Wien AUSTRIA EUROPE
next prev parent reply other threads:[~2000-01-05 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-05 5:00 Why does this code dont work on Alpha? Pete
2000-01-05 5:00 ` Andreas Krall [this message]
2000-01-05 5:00 ` Phillip Helbig
2000-01-05 5:00 ` Joe Mario
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