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 300472FE74 for ; Tue, 9 Oct 2001 17:15:22 -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 RAA07299 for ; Tue, 9 Oct 2001 17:15:22 -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 f99LFMN17160 for ; Tue, 9 Oct 2001 17:15:22 -0400 Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f99LFL403524 for axp-list@listman.redhat.com; Tue, 9 Oct 2001 17:15:21 -0400 Received: from gtedhcp-60.inetarena.com (GTEDHCP-60.inetarena.com [206.129.92.60]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f99LFKg03519 for ; Tue, 9 Oct 2001 17:15:20 -0400 Received: (from rob@localhost) by gtedhcp-60.inetarena.com (8.11.6/8.11.6) id f99LFJq22058 for axp-list@redhat.com; Tue, 9 Oct 2001 14:15:19 -0700 Date: Tue, 9 Oct 2001 14:15:19 -0700 From: "Robert M. Riches Jr." Message-Id: <200110092115.f99LFJq22058@gtedhcp-60.inetarena.com> To: axp-list@redhat.com Subject: Re: denormalized FP numbers causing exceptions 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: 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