From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,630a2b21ae50610a X-Google-Attributes: gid103376,public From: Karl Cooper {46901} Subject: Re: Math error in Annex G ??? Date: 1996/07/25 Message-ID: <31F7B2B3.41C67EA6@swl.msd.ray.com>#1/1 X-Deja-AN: 170813611 references: <1996Jul24.214556.24621@ocsystems.com> content-type: text/plain; charset=us-ascii organization: Raytheon Electronic Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4m) Date: 1996-07-25T00:00:00+00:00 List-Id: 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; ..." > 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.