Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> When doing the refactoring, they needed to provide new implementations for every opcode. Someone accidentally turned Math.abs() into the identity function for the super-optimized level. But nobody noticed because it almost never ran — and was right half of the time when it did.

That's the perfect optimization: extremely fast, and mostly right -- probably more often than 50% if there are more positive numbers than negative ones.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: