From owner-freebsd-questions Mon Feb 2 23:48:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA11948 for questions-outgoing; Mon, 2 Feb 1998 23:48:51 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cyclone.degnet.baynet.de (www.degnet.baynet.de [194.95.214.129]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id XAA11943 for ; Mon, 2 Feb 1998 23:48:47 -0800 (PST) (envelope-from malte@webmore.com) Received: from niente (unverified [194.95.214.182]) by cyclone.degnet.baynet.de (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 03 Feb 1998 08:46:28 +0100 Message-Id: <3.0.32.19980203083924.02fad158@cyclone.degnet.baynet.de> X-Sender: moos@cyclone.degnet.baynet.de X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Tue, 03 Feb 1998 08:39:25 -0100 To: Tom Bartol From: Malte Lance Subject: Re: IEEE Floating Point question: Inf and NaN Cc: questions@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" Try catching the fp-exceptions with a signal-handler and apropriate masks. Makes up to 10 additional lines of code. Malte Lance malte@webmore.com At 16:33 02.02.98 -0800, you wrote: > >Hi, > >I am asking this question on behalf of a friend who is helping to develop >a very nice mathematics tool. I finally convinced him to try FreeBSD >(after much coaxing -- yeah!!), however in porting his code from Linux to >FreeBSD he has discovered that the math libraries in FreeBSD (2.2.5 and >-current) do not return "Inf" on 1.0/0.0 or "NaN" on 0.0/0.0 but rather >result in a rather unpleasant "Floating exception (core dumped)" !!! Is >there some way to change this behavior so that it returns Inf or NaN as >appropriate. I've compiled a little test program under native FreeBSD and >under /compat/linux and have found that the /compat/linux version returns >the appropriate Inf or NaN. > >If the solution requires writing new code in the core math routines of >FreeBSD, how difficult would it be to tackle this job? What documentation >would aid this quest? It would be a shame to loose a good software >product from a commercial vendor due to something as silly as this. > >Thanks for your help, > >Tom > >