Hacker News new | ask | show | jobs
by StilesCrisis 90 days ago
Anything that overflows the max float turns into infinity. You can multiply very large numbers, or divide large numbers into small ones.
1 comments

Sure, division might be a tad more surprising though since most don't do that on an every-day basis. The specific case we had was when a colleague had rewritten

  (a / b) * (c / d) * (e / f)
to

  (a * c * e) / (b * d * f)
as a performance optimization. The result of each division in the original was all roughly one due to how the variables were computed, but the latter was sometimes unstable because the products could produce denomalized numbers.