This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: abs / magnitude
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Re: abs / magnitude
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Thu, 11 May 2000 11:23:44 +0200 (MEST)
On Wed, 10 May 2000, Dirk Herrmann wrote:
> Hello!
>
> Guile defines abs as magnitude. But, is it allowed to call abs on complex
> numbers?
R5RS about abs:
`Abs' returns the absolute value of its argument.
R5RS about magnitude:
These procedures are part of every implementation that supports general
complex numbers. Suppose x1, x2, x3, and x4 are real numbers and z is a
complex number such that z = x1 + x2i = x3 . e^i x4. Then [...]
(magnitude z) ==> |x3|
[...]
Rationale: `Magnitude' is the same as abs for a real argument, but `abs'
must be present in all implementations, whereas `magnitude' need only
be present in implementations that support general complex numbers.
I interpret this as if complex arguments for 'abs' are not allowed. If
nobody objects I will just remove the line (set! abs magnitude) from
boot-9.scm.
Best regards
Dirk Herrmann