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: [9fans] Problem with native vs APE math
Date: Sun, 30 Jul 2000 23:22:31 -0600	[thread overview]
Message-ID: <001601bffab0$900b21e0$0500a8c0@telusplanet.net> (raw)

Here is my example program, running on a Celeron 400MHz. with the June 17
release. I have built it in native mode (mk, 8c, 8l) and in the APE
environment. It works when built in APE (and also, with minor mods in
linux). The native mode executable suicides during the log(0.0L) call:
edemo 355: sys: fp: invalid fppc=0x1391 pc=0x00001050

The library code looks ok. It should return -Inf for log(0) and NaN for
log(-1), which is what the APE does.

Any ideas?

#ifdef _POSIX_SOURCE
#include <stdio.h>
#include <math.h>
#else
#include <u.h>
#include <libc.h>
#include <stdio.h>
#endif
int main(int argc, char* argv[])
{
 printf("log(1.0) = %f\n", log(1.0L));
 printf("log(0.0) = %f\n", log(0.0L));
 printf("log(-1.0) = %f\n", log(-1.0L));
 return 0;
}
--  --
Doug Henderson, Calgary, Alberta, Canada




             reply	other threads:[~2000-07-31  5:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-31  5:22 Doug Henderson [this message]
2000-07-31  6:27 Russ Cox
2000-07-31 14:40 ` 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='001601bffab0$900b21e0$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).