Friday, April 27, 2018 [Tweets] [Favorites]

JavaScript’s Tricky Rounding

Peter Ammon:

Unfortunately, the implementation in the spec does not correctly implement the spec.


JavaScript presumably rounds this odd way to match Java, and so the only engine to get it right out of the gate is Rhino, which simply calls back to Java’s Math.round. Amusingly Oracle fell into the same trap with Rhino’s successor Nashorn. Round and round we go!


Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment