From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lacrosse.corp.redhat.com (host154.207-175-42.redhat.com [207.175.42.154]) by listman.redhat.com (Postfix) with ESMTP id AFDFD2FF59 for ; Tue, 9 Oct 2001 17:35:43 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.44.254]) by lacrosse.corp.redhat.com (8.9.3/8.9.3) with ESMTP id RAA19205 for ; Tue, 9 Oct 2001 17:35:43 -0400 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id f99LZhN20692 for ; Tue, 9 Oct 2001 17:35:43 -0400 Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f99LZhP07272 for axp-list@listman.redhat.com; Tue, 9 Oct 2001 17:35:43 -0400 Received: from mailgw1a.lmco.com (mailgw1a.lmco.com [192.31.106.7]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f99LZgg07267 for ; Tue, 9 Oct 2001 17:35:42 -0400 Received: from emss02g01.ems.lmco.com (relay2.ems.lmco.com [166.29.2.54]) by mailgw1a.lmco.com (8.8.8/8.8.8) with ESMTP id PAA15601 for ; Tue, 9 Oct 2001 15:35:41 -0600 (MDT) Received: from CONVERSION-DAEMON by lmco.com (PMDF V5.2-33 #38887) id <0GKY00I01JZCS3@lmco.com> for axp-list@redhat.com; Tue, 9 Oct 2001 15:35:39 -0600 (MDT) Received: from emss06m01.ems.lmco.com ([134.5.45.74]) by lmco.com (PMDF V5.2-33 #38887) with ESMTP id <0GKY00FAXJZ6CY@lmco.com> for axp-list@redhat.com; Tue, 09 Oct 2001 15:35:30 -0600 (MDT) Received: from etpc87.mar.lmco.com ([134.5.194.187]) by emss06m01.ems.lmco.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 4273JWSV; Tue, 09 Oct 2001 17:36:40 -0400 Received: from etpc87.mar.lmco.com (IDENT:g595455@localhost [127.0.0.1]) by etpc87.mar.lmco.com (8.11.0/8.11.0) with ESMTP id f99LZT102497 for ; Tue, 09 Oct 2001 17:35:29 -0400 Date: Tue, 09 Oct 2001 17:35:29 -0400 From: Daniel Green Subject: Re: denormalized FP numbers causing exceptions To: axp-list@redhat.com Message-id: <3BC36DA1.811B29F8@etpc87.mar.lmco.com> Organization: Lockheed Martin Aeronautics MIME-version: 1.0 X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.10 alpha) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en References: <200110092115.f99LFJq22058@gtedhcp-60.inetarena.com> X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: I am not sure if you can tell the compiler to handle them better, but you can and probably should check for them your self. Look at the fpclassify function. It will tell you if have and fp number problems. If it returns that your number is normalized, then you can continue. There are about eight different states that a floating point number can have; quiet signaling signaling positive denormalized negative denormalized positive zero negative zero positive normal negative normal Hope this helps, Dan "Robert M. Riches Jr." wrote: > Oops! Make that 10^-300-10^-308: > > 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 > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list