unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* rationalize bug
@ 2008-08-11 17:19 Bill Schottstaedt
  2008-12-02 19:11 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Schottstaedt @ 2008-08-11 17:19 UTC (permalink / raw)
  To: bug-guile

I hate to report a bug in my own handiwork, but I noticed
this morning, while writing a scheme numerics test suite
(numtst.c in the Snd tools directory), that if the error is
1.0, rationalize rounds the wrong way:

guile> (rationalize 0.1 1.0)
1.0
guile> (rationalize -0.9 1.0)
0.0

Rats.  I'll try to look at libguile/numbers.c soon.






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

* Re: rationalize bug
  2008-08-11 17:19 rationalize bug Bill Schottstaedt
@ 2008-12-02 19:11 ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2008-12-02 19:11 UTC (permalink / raw)
  To: bug-guile

Hello Bill,

"Bill Schottstaedt" <bil@ccrma.Stanford.EDU> writes:

> I hate to report a bug in my own handiwork, but I noticed
> this morning, while writing a scheme numerics test suite
> (numtst.c in the Snd tools directory), that if the error is
> 1.0, rationalize rounds the wrong way:
>
> guile> (rationalize 0.1 1.0)
> 1.0
> guile> (rationalize -0.9 1.0)
> 0.0
>
> Rats.  I'll try to look at libguile/numbers.c soon.

Any news on that?  :-)

Thanks,
Ludo'.





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

* re: rationalize bug
@ 2008-12-03 15:04 Bill Schottstaedt
  0 siblings, 0 replies; 3+ messages in thread
From: Bill Schottstaedt @ 2008-12-03 15:04 UTC (permalink / raw)
  To: bug-guile

>> Rats.  I'll try to look at libguile/numbers.c soon.
> Any news on that?  :-)

No -- sorry -- my TODO list is so long, even emacs complains.

(There's a problem: the scheme spec seems to insist on the "simplest"
ratio which they define in terms of the size of the integers -- my 
rationalize used continued fractions so it's fast (worst case involves
successive fibonacci numbers, I think), but it's not always "simplest".
I think the scheme spec is silly -- this reminds me of (random 0.0)
in CL which is flagged as an error -- obviously CL-types have no idea
why you'd use random, and similarly for rationalize in scheme).






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

end of thread, other threads:[~2008-12-03 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-11 17:19 rationalize bug Bill Schottstaedt
2008-12-02 19:11 ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2008-12-03 15:04 Bill Schottstaedt

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 read-only IMAP folder(s) and NNTP newsgroup(s).