comp.lang.ada
 help / color / mirror / Atom feed
From: Karl Cooper {46901} <ktc@swl.msd.ray.com>
Subject: Re: Math error in Annex G ???
Date: 1996/07/25
Date: 1996-07-25T00:00:00+00:00	[thread overview]
Message-ID: <31F7B2B3.41C67EA6@swl.msd.ray.com> (raw)
In-Reply-To: 1996Jul24.214556.24621@ocsystems.com


Joel VanLaven wrote:

>   The LRM says (liberty taken with spacing):
> "... exponentiating the modulus by the given exponent;
>  multiplying the argument by the given exponent,
>    when the exponent is positive,
>  or dividing the argument by the absolute value of the given exponent,
>    when the exponent is negative; ..."
<snip...>
> I am almost positive that the desired math is:
> for all n
>    (r,theta)**n=(r**n,n*theta)
> 

Yes, your mathematics is correct, and the permission given in the LRM
would result in errors if actually adopted by a language implementor.

The LRM also permits the implementor to use repeated complex multiplication,
with a possible final complex reciprocation (when the exponent is negative),
which would result in correct (if potentially inefficient) calculation.

And, of course, no implementor is bound by the permissions.

Does anyone know if this slip in the LRM was actually adopted in any
particular Ada 95 implementation?  Shall we all go out and test our compiler?

I have sometimes wondered why the exponent is limited to integral values,
but perhaps we should be grateful that the LRM didn't try to explain raising
a complex number to a complex power.




      parent reply	other threads:[~1996-07-25  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-24  0:00 Math error in Annex G ??? Joel VanLaven
1996-07-25  0:00 ` Robert A Duff
1996-07-26  0:00   ` Robert I. Eachus
1996-07-25  0:00 ` Karl Cooper {46901} [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox