Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-06 Thread Neil Jerram
Noah Lavine noah.b.lav...@gmail.com writes: Hello Mark, I haven't read through all of the discussion yet, but it's obvious that you have good reasons for wanting (* 0 X) to be NaN when X is NB (and for the record), NaN here should be inexact.

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-06 Thread Neil Jerram
Mark H Weaver m...@netris.org writes: Neil Jerram n...@ossau.uklinux.net writes: In other words, the argument is that any inexact number might actually be infinite. (Right?) Yes. That strikes me as stretching the idea of inexactness too far; and also as not useful, because I'm sure

[PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Mark H Weaver
Here's another batch of numerics patches. The most important one changes the way products involving exact 0 are handled: * libguile/numbers.c (scm_product): Handle exact 0 differently. A product containing an exact 0 now returns an exact 0 if and only if the other arguments are all exact.

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Andy Wingo
Hi Mark, On Tue 01 Feb 2011 13:09, Mark H Weaver m...@netris.org writes: Subject: [PATCH] Trigonometric functions return exact numbers in some cases Why would you want this? Just wondering. Andy -- http://wingolog.org/

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Andy Wingo
On Tue 01 Feb 2011 13:09, Mark H Weaver m...@netris.org writes: Here's another batch of numerics patches. Thanks, applied all but the trigonometric functions one, pending further discussion. Andy -- http://wingolog.org/

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Neil Jerram
Mark H Weaver m...@netris.org writes: Here's another batch of numerics patches. The most important one changes the way products involving exact 0 are handled: * libguile/numbers.c (scm_product): Handle exact 0 differently. A product containing an exact 0 now returns an exact 0 if and

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Mark H Weaver
Subject: [PATCH] Trigonometric functions return exact numbers in some cases Why would you want this? I'm a developer of Maxima, a free CAS (computer algebra system). I'm interested in building a free CAS on top of Guile, probably with large chunks of functionality adapted from Maxima. As

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Mark H Weaver
Neil Jerram n...@ossau.uklinux.net writes: * libguile/numbers.c (scm_product): Handle exact 0 differently. A product containing an exact 0 now returns an exact 0 if and only if the other arguments are all exact. I don't get this one. I would expect ... are all finite. I almost wrote

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Neil Jerram
Mark H Weaver m...@netris.org writes: The point of the exact/inexact distinction is to ensure that if you see an exact number, you can trust that it is provably the correct answer, and that no inaccuracies associated with inexact arithmetic along the way could possibly have corrupted that

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Mark H Weaver
Neil Jerram n...@ossau.uklinux.net writes: In this case, the inaccuracies associated with inexact arithmetic could result in an infinity being misrepresented as a finite number, or vice versa. For example, if X is inexact, then we cannot claim that the result of (* 0 (/ X)) is an exact 0,

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Noah Lavine
Hello Mark, I haven't read through all of the discussion yet, but it's obvious that you have good reasons for wanting (* 0 X) to be NaN when X is inexact. And yet for compatibility reasons it is nice if Guile agrees with Scheme standards. Therefore I think it would be great if you would send an

Re: [PATCH] Handle products with exact 0 differently, etc

2011-02-01 Thread Mark H Weaver
Noah Lavine noah.b.lav...@gmail.com writes: I haven't read through all of the discussion yet, but it's obvious that you have good reasons for wanting (* 0 X) to be NaN when X is inexact. And yet for compatibility reasons it is nice if Guile agrees with Scheme standards. In case there is any