From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 7954E3EB48 for ; Tue, 2 Jul 2002 17:18:54 -0400 (EDT) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id g62LIrq24276 for axp-list@listman.redhat.com; Tue, 2 Jul 2002 17:18:53 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id g62LIra24272 for ; Tue, 2 Jul 2002 17:18:53 -0400 Received: from vrod.sector7.com ([207.207.41.10]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id g62L8v932020 for ; Tue, 2 Jul 2002 17:08:58 -0400 Received: from stout (IDENT:WTf1AMPPmUiWnr6Uyd6mqrfgzSmB3s8X@vrod.sector7.com [127.0.0.1]) (authenticated) by vrod.sector7.com (8.11.6/8.11.6) with ESMTP id g62LBmw20682 for ; Tue, 2 Jul 2002 16:11:48 -0500 X-Chris: Chris_Eleveld@sector7.com Tue Jul 2 16:11:48 2002 stout chris_eleveld From: "Chris Eleveld" To: Subject: RE: Floating point on alpha - SOLUTION 1 Date: Tue, 2 Jul 2002 16:18:40 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <007601c22209$e53b1620$6501a8c0@josephas> 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: Shouldn't this generate NaN(Not A Number) verifiable by if (b != b)printf("NaN!\n"); -----Original Message----- From: axp-list-admin@redhat.com [mailto:axp-list-admin@redhat.com] On Behalf Of Joseph Ashwood Sent: Tuesday, July 02, 2002 3:46 PM To: axp-list@redhat.com Subject: Re: Floating point on alpha - SOLUTION 1 ----- Original Message ----- From: "Linus Gasser" > F*CK with -miee I can divide by 0 w/o trouble! What the heck is this? I can > have > > double a = 0, b = 1, c = 2; > b = c / a; > > Someone wake me up! What is going on here? There are a few possible explanations, sorry I don't know which one it is don't have Alpha docs in front of me right now. Depending on the chip itself, it may actually have a 0 for floating point numbers, 0 will actually be 2^-500 or something, which will introduce very small errors, but usually nothing that is critical. This takes care of division by 0 very cleanly, by eliminating the possibility. The second possibility is that division by 0 results in a special code output, IIRC Alpha does NOT use this one, it is exclusively the realm of PowerPC. Third possibility, division by 0 creates an output of infinite, if you print this to the screen it is generally printed as "#INF" or something similar. The fourth possibility is that -mieee switched off the floating point signaling completely so your division by 0 error goes undetected, and b receives garbage. It will take some experimentation and documentation to determine which of these (possibly case 1 and 3 in some cases) is the actual result. If you are writing something the needs to be portable, you will need to address all of these cases, since different systems behave slightly differently. Joe _______________________________________________ Axp-list mailing list Axp-list@redhat.com https://listman.redhat.com/mailman/listinfo/axp-list