chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] numerator/denominator


From: Thomas Bushnell BSG
Subject: Re: [Chicken-hackers] numerator/denominator
Date: Tue, 04 Aug 2009 10:41:34 -0700

On Tue, 2009-08-04 at 10:40 -0700, Elf wrote:
> rational? always returns true for all numbers.

Yes, and how is that a problem?

It is perfectly r5rs compliant to have all flonums be real? and
rational? (as they are in Chicken Scheme).  The only time rational? must
disagree with real? is if a system has a way to represent irrational
numbers exactly.  It is *permitted* for rational? to disagree with real?
more than that (if they are inexact), but it is not *required*.

Chicken Scheme takes the normal approach of identifying rational? and
real?.  See 6.2.5, which says "In many implementations the rational?
procedure will be the same as real? ... but unusual implementations may
be able to represent irrational numbers exactly..."

We are one of the "many implementations".  

Thomas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]