4 ms·
> Oh and apparently you can buy a Sundae for as little as $.999999999999999949. Damn, I was sure hackers here would test the edge cases, but I thought it would
by pluies 16y ago
> Oh and apparently you can buy a Sundae for as little as $.999999999999999949.
Damn, I was sure hackers here would test the edge cases, but I thought it would hold! :) What you describe look like a weird behaviour in Ruby's string parsing to int (if I remember my code correctly), but I'll look into it.
- ElbertF 16y agoI wouldn't worry about it, it's just how Ruby and most other languages handle floats. Do a search on Google for "ruby float precision".