News for hackers. Stuff that matters.
Re:JavaScript Coercions Grid by detaro on Sunday March 31, 2019 @10:19AM (#19535689)
IEEE 754 says √–0 is –0 though.
Re:JavaScript Coercions Grid by jacobolus on Sunday March 31, 2019 @01:52PM (#19537018)
Ah really? What is the purpose of that?
Re:JavaScript Coercions Grid by detaro on Sunday March 31, 2019 @02:06PM (#19537109)
Not sure. Via https://stackoverflow.com/questions/19236117/what-numerical-... I found https://people.freebsd.org/~das/kahan86branch.pdf, but that's a more complex read than I'm prepared for right now ;)
Re:JavaScript Coercions Grid by jacobolus on Sunday March 31, 2019 @05:22PM (#19538486)
That paper is about implementing branch cuts in a complex-valued function (e.g. complex square root), and doesn’t discuss real square roots.

In the context of that paper it seems to me that √(–0 – 0i) should be 0 – 0i and √(–0 + 0i) should be 0 + 0i, but under no circumstances should the result be –0 ± 0i, which is on the wrong branch.

The obvious extension to real-valued square root would be √(–0) == +0.