[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: paper-defaults-init.ly questions
From: |
Carl Sorensen |
Subject: |
Re: paper-defaults-init.ly questions |
Date: |
Fri, 3 Dec 2010 10:13:38 -0700 |
On 12/3/10 8:06 AM, "David Kastrup" <address@hidden> wrote:
> Mark Polesky <address@hidden> writes:
>
>> David Kastrup wrote:
>>>> mm = #1.0
>>>> cm = #(* 10 mm)
>>>> in = #(* 25.4 mm)
>>>> pt = #(/ in 72.27)
>>>
>>> Wouldn't pt = #(/ (* 2540 mm) 7227) have smaller absolute
>>> error? The current definition of pt has to round 25.4 to
>>> the nearest presentable number, 72.27 to the nearest
>>> presentable number, and then round the result of the
>>> division again.
>>
>> No, I don't think so. Isn't scheme a little smarter than
>> that?
>
> No, it isn't.
>
>> Consider the following:
>>
>> $ guile
>> guile> (define mm 1.0)
>> guile> (define in (* 25.4 mm))
>> guile> (define pt (/ in 72.27))
>> guile> (equal? pt (/ (* 2540 mm) 7227))
>> #t
>
> Platform dependent luck.
We can define all of these as exact quantities:
guile> (define mm 1)
guile> (define cm (* 10 mm))
guile> (define in (* 254 (/ mm 10)))
guile> (define pt (/ (* 100 in) 7227))
guile> (exact? mm)
#t
guile> (exact? cm)
#t
guile> (exact? in)
#t
guile> (exact? pt)
#t
Thanks,
Carl
- paper-defaults-init.ly questions, Mark Polesky, 2010/12/01
- Re: paper-defaults-init.ly questions, Patrick McCarty, 2010/12/02
- Re: paper-defaults-init.ly questions, David Kastrup, 2010/12/03
- Re: paper-defaults-init.ly questions, Mark Polesky, 2010/12/03
- Re: paper-defaults-init.ly questions, David Kastrup, 2010/12/03
- Re: paper-defaults-init.ly questions,
Carl Sorensen <=
- Re: paper-defaults-init.ly questions, David Kastrup, 2010/12/03
- Re: paper-defaults-init.ly questions, Mark Polesky, 2010/12/04
- Re: paper-defaults-init.ly questions, Carl Sorensen, 2010/12/04
- Re: paper-defaults-init.ly questions, Mark Polesky, 2010/12/04
- Re: paper-defaults-init.ly questions, Carl Sorensen, 2010/12/04
- Re: paper-defaults-init.ly questions, David Kastrup, 2010/12/04
- Re: paper-defaults-init.ly questions, Carl Sorensen, 2010/12/04
- Re: paper-defaults-init.ly questions, David Kastrup, 2010/12/05
Re: paper-defaults-init.ly questions, Mark Polesky, 2010/12/04