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

* Re: [9fans] Re: debugging help asked for
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Miller @ 2007-05-21 18:29 UTC (permalink / raw)
  To: 9fans

I said:

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

Of course, the result will probably then be wrong in both
Plan 9 and linux because you're still dividing by zero ...



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

* Re: [9fans] Re: debugging help asked for
  2007-05-21 18:29 ` Richard Miller
@ 2007-05-22  0:33   ` ron minnich
  2007-05-22  8:52     ` Richard Miller
  0 siblings, 1 reply; 5+ messages in thread
From: ron minnich @ 2007-05-22  0:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 5/21/07, Richard Miller <9fans@hamnavoe.com> wrote:
> I said:
>
> > In this particular case, you can get the same result as
> > gcc/linux by doing these two things:
>
> Of course, the result will probably then be wrong in both
> Plan 9 and linux because you're still dividing by zero ...

makes me feel warm and toasty inside ... are B787s modeled on linux?
probably :-)

ron


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

* Re: [9fans] Re: debugging help asked for
  2007-05-22  0:33   ` ron minnich
@ 2007-05-22  8:52     ` Richard Miller
  2007-05-22 14:52       ` ron minnich
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Miller @ 2007-05-22  8:52 UTC (permalink / raw)
  To: 9fans

Ron says (ironically I hope):
> makes me feel warm and toasty inside

On a more serious note, why is the default in gcc/linux to switch off
floating point divide-by-zero exceptions?  Ron, are your "computational
scientist" colleagues really more comfortable when the intermediate
results of their calculataions are full of INFs and NANs?  Wouldn't
they rather be told when they're doing something mathematically invalid?



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

* Re: [9fans] Re: debugging help asked for
  2007-05-22  8:52     ` Richard Miller
@ 2007-05-22 14:52       ` ron minnich
  0 siblings, 0 replies; 5+ messages in thread
From: ron minnich @ 2007-05-22 14:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 5/22/07, Richard Miller <9fans@hamnavoe.com> wrote:
> Ron says (ironically I hope):
> > makes me feel warm and toasty inside
>
> On a more serious note, why is the default in gcc/linux to switch off
> floating point divide-by-zero exceptions?

Must make TLB reloads work better.

>Ron, are your "computational
> scientist" colleagues really more comfortable when the intermediate
> results of their calculataions are full of INFs and NANs?  Wouldn't
> they rather be told when they're doing something mathematically invalid?

What they don't know must not have hurt them.

Did the wing always bend quite that way? It seems a little -- wait ---


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