*BSD News Article 43631


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!news.hawaii.edu!ames!taligent!uunet!news.mathworks.com!gatech!howland.reston.ans.net!Germany.EU.net!zib-berlin.de!irz401!narcisa.sax.de!not-for-mail
From: j@narcisa.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Behaviour of math functions
Date: 24 Apr 1995 13:14:22 +0200
Organization: Private U**x site, Dresden.
Lines: 20
Message-ID: <3ng16e$j7j@bonnie.tcd-dresden.de>
References: <D7ApIA.M3@rob1.hobby.nl>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Rob Jacobs <root@rob1.hobby.nl> wrote:
>In FreeBSD 2.0, domain errors in math functions (e.g. acos()), result
>in reserved operands being produced which stop computation (SIGFPE).
>However, this behaviour is not expected by many applications (e.g. Tcl
>checks "errno" for a domain error after calling a math function, but
>it will never get there because of the SIGFPE).

Try

#include <machine/floatingpoint.h>

fpsetmask(0);

at the beginning of your program.  This is a hack, but might work for
you.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)