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

*To*: srfi-77@xxxxxxxxxxxxxxxxx*Subject*: Re: My comments*From*: "Bradd W. Szonye" <bradd+srfi@xxxxxxxxxx>*Date*: Wed, 19 Oct 2005 15:08:00 -0700*Delivered-to*: srfi-77@xxxxxxxxxxxxxxxxx*In-reply-to*: <87fyqxb6i6.fsf@xxxxxxxxxxxxx>*Mail-followup-to*: srfi-77@xxxxxxxxxxxxxxxxx*References*: <87wtk9qro1.fsf@xxxxxxxxxxxxx> <20051019191720.GA24703@xxxxxxxxxxxxxxxx> <87fyqxb6i6.fsf@xxxxxxxxxxxxx>*User-agent*: Mutt/1.4.2.1i

Marcin 'Qrczak' Kowalczyk wrote: > [The gcd, lcm, numerator, and denominator functions have] ill-defined > results when the inputs are not known exactly: the slighthest > inaccuracy in the input yields a totally different answer. R5RS gives > them too broad domain. Earlier I said that these functions are useless, but it just occurred to me that they're necessary whenever you want to deal with a rational number as a fraction (e.g., to carry out algebraic transformations or for custom output). In those cases, it doesn't matter whether the functions are accurate, so long as they're self-consistent. For example, suppose that some calculation produces the inexact result 1/3 as an approximation to 219/658, and you want to write the fraction into a TeX document. It doesn't matter that the numerator and denominator are "wrong," because when you print them together as "1/3" you still get the correct (if inexact) number. Likewise, if you're performing algebraic transformations, it doesn't matter if the GCD or LCM are wildly inaccurate on their own, because you don't /use/ them on their own. Calculating GCD or LCM is just an intermediate step. and the later steps in the process will get you back to reasonable numbers. These functions are not "ill-defined." Yes, you'll get a totally different result than you would using exact numbers, but that doesn't matter unless you use the results improperly (i.e., taking them out of context instead of preserving their relationships). -- Bradd W. Szonye http://www.szonye.com/bradd

**Follow-Ups**:**Exactness (was Re: My comments)***From:*bear

**References**:**My comments***From:*Marcin 'Qrczak' Kowalczyk

**Re: My comments***From:*Bradd W. Szonye

**Re: My comments***From:*Marcin 'Qrczak' Kowalczyk

- Prev by Date:
**Re: My comments** - Next by Date:
**Exactness (was Re: My comments)** - Previous by thread:
**Re: My comments** - Next by thread:
**Exactness (was Re: My comments)** - Index(es):