[cfp-interest 3746] Re: division of a real by a complex
Paul Zimmermann
Paul.Zimmermann at inria.fr
Mon Dec 15 00:37:08 PST 2025
thank you Fred.
> From: "Fred J. Tydeman" <tydeman at tybor.com>
> Date: Sat, 13 Dec 2025 14:04:57 +1300 (TOT)
>
> On Fri, 12 Dec 2025 12:08:53 +0100 Paul Zimmermann wrote:
> >
> >we had this question on the GNU MPC list: how should the division of a
> >real number by a complex number be defined? In particular (-1)/(+0 + 1*i)?
> >
> >See the thread starting at
> >https://sympa.inria.fr/sympa/arc/mpc-discuss/2025-12/msg00000.html
> >
> >In GNU MPC, we convert the real number to a complex number with a +0
> >imaginary part, and then call complex division.
> >
> >Is there any other definition that makes more sense?
>
> (-1) / (+0 + 1*I)
>
> ================
> The normal math formula (multiply by conjugate/conjugate)
> (-1) (+0 - 1*I)
> ---------- * ----------
> (+0 + 1*I) (+0 - 1*I)
>
> (-0 + 1*I) (-0 + 1*I)
> == ------------ == ---------- == (-0 + 1*I)
> (+0 - 1*I*I) (+0+1 )
>
> ================
> The normal math formula (convert real to complex, then multiply by conjugate/conjugate)
> (-1 + 0*I) (+0 - 1*I)
> ---------- * ----------
> (+0 + 1*I) (+0 - 1*I)
>
> (-0-0*I*I + 1*I) (-0+0 + 1*I)
> == ---------------- == ------------ == (+0 + 1*I)
> (+0 - 1*I*I) (+0+1 )
this is what we do in GNU MPC: we first convert the numerator to complex,
with the rule that an non-existent imaginary part becomes +0, and then
apply complex division.
Best regards,
Paul
> ================
> Treat (+0 + 1*I) as just 1*I, ie, on imaginary axis, then multiply by I/I
> (-1) (1*I) -1*I -1*I
> ----- * ----- == ----- == ---- == 1*I == (+0 + 1*I)
> (1*I) (1*I) 1*I*I -1
>
>
> ---
> Fred J. Tydeman Tydeman Consulting
> tydeman at tybor.com Testing, numerics, programming
> +1 (702) 608-6093 Vice-chair of INCITS/C (ANSI "C")
> Sample C17+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
>
More information about the cfp-interest
mailing list