From owner-freebsd-questions Tue Mar 2 23:13:32 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id AA35A14EE1 for ; Tue, 2 Mar 1999 23:12:40 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.8.8) id CAA04352; Wed, 3 Mar 1999 02:19:11 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199903030719.CAA04352@cc942873-a.ewndsr1.nj.home.com> Subject: Re: FP Math In-Reply-To: <36DCD162.AC62A10E@TurnAround.com.au> from Andrew Johns at "Mar 3, 99 05:06:26 pm" To: A_Johns@TurnAround.com.au (Andrew Johns) Date: Wed, 3 Mar 1999 02:19:11 -0500 (EST) Cc: cjclark@home.com, gjb@comkey.com.au, freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrew Johns wrote, > "Crist J. Clark" wrote: > > > For example, the above program returns, > > > > inf > > > > On my SGI. > > > > inf = infinity?? Yes, that is what the output means. > ie: overflow Yep. > ie: exception if overflow is not trapped Nope, there is no floating point exception, no trapping. > => SGI is merely trapping the oveflow. Right, which I would like my FreeBSD to do. This goes back to my original question, that was dropped in the first response, how can I make sure I am using IEEE STANDARD 754 Floating-Point Arithmetic, where ('man math'), Exceptions: IEEE 754 recognizes five kinds of float- ing-point exceptions, listed below in declining order of probable importance. Exception Default Result __________________________________________ Invalid Operation NaN, or FALSE Overflow +-Infinity Divide by Zero +-Infinity Underflow Gradual Underflow Inexact Rounded value NOTE: An Exception is not an Error unless handled badly. What makes a class of excep- tions exceptional is that no single default response can be satisfactory in every instance. On the other hand, if a default response will serve most instances satisfac- torily, the unsatisfactory instances cannot justify aborting computation every time the exception occurs. The program itself never receives a SIGFPE in my example. My example is not an 'exceptional exception.' -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message