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.
Fixed by commit [8cd252].
Related
Commit: [8cd252]