9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Doug Henderson" <djhender@telusplanet.net>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] Problem with native vs APE math
Date: Mon, 31 Jul 2000 08:40:34 -0600	[thread overview]
Message-ID: <001601bffafd$f5763d60$0500a8c0@telusplanet.net> (raw)
In-Reply-To: <200007310627.CAA07797@cse.psu.edu>

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" <rsc@plan9.bell-labs.com>
To: <djhender@telusplanet.net>; <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
>




  reply	other threads:[~2000-07-31 14:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-31  6:27 Russ Cox
2000-07-31 14:40 ` Doug Henderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-07-31  5:22 Doug Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001601bffafd$f5763d60$0500a8c0@telusplanet.net' \
    --to=djhender@telusplanet.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).