Docs: std.math.conj wrong

Don Clugston dac at nospam.com.au
Wed Apr 11 16:56:25 PDT 2007


Daniel Keep wrote:
> The documentation for std.math.conj states:
> 
>  `` Note that z * conj(z) = z.re^2 - z.im^2 is always a real number ''
> 
> This *should* say:
> 
>  `` Note that z * conj(z) = z.re^2 + z.im^2 is always a real number ''
> 
> Proof:
> 
> given
>         z = x + iy
>   conj(z) = x - iy
> 
> then
> z*conj(z) = (x + iy)(x - iy)
>           = x^2 - ixy + ixy - (i^2 y^2)  -- Two ixy's cancel out
>           = x^2 - ((-1)y^2)  -- i^2 = (-1)
>           = x^2 - (-y^2)
>           = x^2 + y^2
>             QED
> 
> As far as I can tell, this is purely a documentation issue, not a code one.
> 
> 	-- Daniel
> 
This also applied to Tango -- it's now been fixed there.


More information about the Digitalmars-d-bugs mailing list