Hacker News new | past | comments | ask | show | jobs | submit login

Heh that's a really interesting bug!

Would it be possible to avoid floats completely for the game's calculation?

I made a little uptime faker for Linux, it's not as clever as this one though as it's not altering the kernel timers directly https://www.anfractuosity.com/projects/uptime




You can always use fixed points instead of floating points if you have to use decimal numbers. https://en.wikipedia.org/wiki/Fixed-point_arithmetic

There are many libraries for that, e.g. https://github.com/XMunkki/FixPointCS


Or just use a double. It has 53 bits of mantissa.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: