From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <001601bffafd$f5763d60$0500a8c0@telusplanet.net> From: "Doug Henderson" To: <9fans@cse.psu.edu> References: <200007310627.CAA07797@cse.psu.edu> Subject: Re: [9fans] Problem with native vs APE math Date: Mon, 31 Jul 2000 08:40:34 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: ef40f914-eac8-11e9-9e20-41e7f4b1d025 On my Celeron, I get log(1)=0, log(0)=-HUGE_VAL and log(-1)=-HUGE_VAL, which is what I expect from reading the code for log in /sys/src/ape/lib/ap/math/log.c, and errno is set to ERANGE for log(0) and EDOM for log(-1). Clearing the FPINVAL bit in the pcr gets rid of the suicides. There is an undocumented bit set in psr after log(0). Also, there is a mismatch between some defines in ape/float.h and ape/sys/fp.h ----- Original Message ----- From: "Russ Cox" To: ; <9fans@cse.psu.edu> Sent: Monday, July 31, 2000 12:27 AM Subject: Re: [9fans] Problem with native vs APE math > When I compile that using APE I get 0.00000 > for all the answers, which is not what I expected > but not unreasonable given the code. > I don't think that the APE libraries use Inf and NaN. > > As for why it crashes natively, you need to > turn off some exceptions related to use of > Inf and NaN -- see getfcr(2). > > Russ >