Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1, 1.2, 2.0
-
None
-
None
-
all
Description
The formula that 'divide' wants to implement is
( a + bi ) / ( c + di ) = ( ac + bd + ( bc - ad ) i ) / ( c^2 + d^2 )
as correctly written in the description.
When c == 0.0 this leads to the special case
( a + bi ) / di = ( b / d ) - ( a / d ) i
But the corresponding code is:
if (c == 0.0) {
return createComplex(imaginary/d, -real/c);
}
The bug is the last division -real/c, which should obviously be -real/d.