[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: (gcd -2) -> -2

**From**: |
Mikael Djurfeldt |

**Subject**: |
Re: (gcd -2) -> -2 |

**Date**: |
Tue, 12 Aug 2008 16:28:55 +0200 |

2008/8/12 Neil Jerram <address@hidden>:
>* 2008/8/12 Bill Schottstaedt <address@hidden>:*
>*> gcd is supposed to ignore factors of -1.*
>
>* According to? (I'm not suggesting that you're wrong. I'd just like*
>* you to be precise about your references.)*
R5RS:
6.2.5 Numerical operations
-- library procedure: gcd n1 ...,
-- library procedure: lcm n1 ...,
These procedures return the greatest common divisor or least common
multiple of their arguments. The result is always non-negative.
(gcd 32 -36) ==> 4
(gcd) ==> 0
(lcm 32 -36) ==> 288
(lcm 32.0 -36) ==> 288.0 ; inexact
(lcm) ==> 1
>*> "<" is restricted to reals -- a complex arg should be an error.*
>
>* Again, is that specified?*
>
>* Mathematically, I can't help wondering about Lim(x + iy) as y -> 0.*
>* Or, in Scheme terms, about inexact numbers. Does inexactness in*
>* Scheme pertain only to the real dimension?*
Mathematically, < doesn't have a meaning if its arguments complex,
i.e. if y above isn't exactly zero. In Scheme terms, I guess one has
to consider a number real if the imaginary part is 0.0 even though it
is an inexact real number...