Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Feb 1998 08:39:25 -0100
From:      Malte Lance <malte@webmore.com>
To:        Tom Bartol <bartol@salk.edu>
Cc:        questions@FreeBSD.ORG
Subject:   Re: IEEE Floating Point question: Inf and NaN
Message-ID:  <3.0.32.19980203083924.02fad158@cyclone.degnet.baynet.de>

next in thread | raw e-mail | index | archive | help
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
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.32.19980203083924.02fad158>