Menu

#2246 WSL: complex sqrt function may return imaginary part with incorrect sign.

WSL
closed
None
Bug
fixed
IINR_-_Include_In_Next_Release
False
2014-12-11
2014-12-09
No

Observed while following up on ticket [#2245], the imaginary part of the result returned by casin() often exhibits "incorrect" sign; this has been traced to incorrect propagation of sign, within the imaginary part returned by each of csqrt(), csqrtf(), and csqrtl().

While convention dictates that the principal square roots returned by these functions should always have real parts with positive sign, it is further conventional that the imaginary part should preserve the sign of the imaginary part of the original complex number, which is passed as function argument; this latter convention is not consistently honoured in MinGW implementations. Rather than continue to maintain these three practically identical implementations, I propose replacing them by the attached generic implementation, which does correctly honour convention, and which will be automatically compiled by existing makefile infrastructure, to create the three requisite object modules.

1 Attachments

Related

Issues: #2245

Discussion

  • Keith Marshall

    Keith Marshall - 2014-12-11

    Fixed by commit [8cd252].

     

    Related

    Commit: [8cd252]

  • Keith Marshall

    Keith Marshall - 2014-12-11
    • status: open --> closed
    • Resolution: none --> fixed
    • Category: Unknown --> IINR_-_Include_In_Next_Release