* numerator/denominator
@ 2005-04-18 21:55 Kevin Ryde
2005-05-24 17:58 ` numerator/denominator Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2005-04-18 21:55 UTC (permalink / raw)
Aubrey Jaffer noticed guile doesn't have r5rs numerator and
denominator and proposes the definitions below. The head has them
already with the exact fractions now, but I think I'll add these to
the 1.6 branch.
(define (numerator q)
(do ((num q (* 2 num)))
((integer? num) num)))
(define (denominator q)
(do ((num q (* 2 num))
(den (- q q -1) (* 2 den)))
((integer? num) den)))
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: numerator/denominator
2005-04-18 21:55 numerator/denominator Kevin Ryde
@ 2005-05-24 17:58 ` Marius Vollmer
0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2005-05-24 17:58 UTC (permalink / raw)
Kevin Ryde <user42@zip.com.au> writes:
> Aubrey Jaffer noticed guile doesn't have r5rs numerator and
> denominator and proposes the definitions below. The head has them
> already with the exact fractions now, but I think I'll add these to
> the 1.6 branch.
Yep, thanks.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-24 17:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-18 21:55 numerator/denominator Kevin Ryde
2005-05-24 17:58 ` numerator/denominator Marius Vollmer
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).