Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Feb 1998 16:33:30 -0800 (PST)
From:      Tom Bartol <bartol@salk.edu>
To:        freebsd-questions@FreeBSD.ORG
Cc:        mika@sdna2.ucsd.edu
Subject:   IEEE Floating Point question: Inf and NaN
Message-ID:  <Pine.BSF.3.96.980202161523.23575G-100000@dale.salk.edu>

next in thread | raw e-mail | index | archive | help

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?Pine.BSF.3.96.980202161523.23575G-100000>