News for hackers. Stuff that matters.
Re:One does not simply calculate the absolute value by Kranar on Sunday August 22, 2021 @03:49PM (#28268892)
That will not handle -0.0 unfortunately since 0 == -0.
Re:One does not simply calculate the absolute value by alisonkisk on Sunday August 22, 2021 @03:52PM (#28268921)
That doesn't matter because Math.max() knows the difference between +0.0 and -0.0.

Try it and you'll see.

Re:One does not simply calculate the absolute value by bordercases on Sunday August 22, 2021 @06:40PM (#28270411)
It does that because of the way they implement arithmetic, not about an inherent property of the mathematical function `max`. The problem has to be solved once.