*BSD News Article 64905


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.ecn.uoknor.edu!qns3.qns.com!imci4!newsfeed.internetmci.com!in2.uu.net!news.sprintlink.net!news.nkn.net!news.panther.net!nemesis!hammy!not-for-mail
From: gordon@sneaky.lerctr.org (Gordon Burditt)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Porting scilab-2,2 - Two problems - Any ideas ??
Date: 30 Mar 1996 15:29:24 -0600
Organization: What organization?
Lines: 26
Message-ID: <4jk93k$b96@hammy.lonestar.org>
References: <4jbkri$1ak@gate.ohs.ie>
NNTP-Posting-Host: news.hammy.lonestar.org

>	I am in the process of porting INRIA's scilab package to FreeBSD
>and am having a bit of a battle with libm over it. Scilab expects to
>generate Infinity and NaN for reference by computing 10000.3^10000.3
>for Infinity and then to get NaN by calculating Infinity-Infinity. But
>all I get out of libm is a floating point exception (ugh).
>
>	So is there a libm replacement anywhere that is IEEE compliant in
>this regard, I am loath to hack up libm.

If you want IEEE-compliant exception handling, stick this at the
front of your program:

# include <floatingpoint.h>

	...
	fpsetmask(0);
	...

This lets the coprocessor handle all the exceptions with default fixups,
like generating infinities and NaNs.

This still works regardless of how the debate over the appropriate
default coprocessor control word turns out.

					Gordon L. Burditt
					sneaky.lerctr.org!gordon