9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Re: debugging help asked for
@ 2007-05-21 18:23 Richard Miller
  2007-05-21 18:29 ` Richard Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Miller @ 2007-05-21 18:23 UTC (permalink / raw)
  To: 9fans

I said:

> Possibly gcc/linux reacts differently to division by zero?

In this particular case, you can get the same result as
gcc/linux by doing these two things:

- at the beginning of main() in PATHd8.c, add this line
	setfcr(getfcr()&~(FPINVAL|FPZDIV));

- in /sys/src/libc/port/log.c function log(), replace this:

 	if(arg <= 0)
		return NaN();

  with this:

	if(arg <= 0 || isNaN(arg))
		return NaN();

-- Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-05-22 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-21 18:23 [9fans] Re: debugging help asked for Richard Miller
2007-05-21 18:29 ` Richard Miller
2007-05-22  0:33   ` ron minnich
2007-05-22  8:52     ` Richard Miller
2007-05-22 14:52       ` ron minnich

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).