From: "Robert M. Riches Jr." <richesr1@inetarena.com>
To: axp-list@redhat.com
Subject: denormalized FP numbers causing exceptions
Date: Tue, 9 Oct 2001 14:03:15 -0700 [thread overview]
Message-ID: <200110092103.f99L3FR21275@gtedhcp-60.inetarena.com> (raw)
On Redhat 7.1, default GCC version 2.96, I'm getting floating
exceptions on what appear to be denormalized numbers. The code
is the Bow (or rainbow) information retrieval toolkit, and it's
blowing up in the following code:
double scores_sum = 0;
for (ci = 0; ci < barrel->cdocs->length; ci++)
scores_sum += scores[ci];
It appears whenever an input to the '+=' operator is less than
10^300, 10^308, or so, I get the floating exception. At least
one of the numbers is around 1, so the tiny numbers could be
rounded to zero and it wouldn't affect the final result. I
suppose I could try to add code to change an array element to
zero if it was less than about 10^290, but this may hit the same
exception as the addition attempt.
Is there a compiler option to either not generate denormalized
numbers or to handle them gracefully?
Thanks.
Robert Riches
richesr1@inetarena.com
rriches@cse.ogi.edu
next reply other threads:[~2001-10-09 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-09 21:03 Robert M. Riches Jr. [this message]
2001-10-09 22:22 ` denormalized FP numbers causing exceptions Uncle George
-- strict thread matches above, loose matches on Subject: below --
2001-10-09 21:15 Robert M. Riches Jr.
2001-10-09 21:35 ` Daniel Green
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