Hacker News new | ask | show | jobs
by wglb 5103 days ago
Now that is in interesting proposition: Let's pretend he said integer since floats for money is outright broken. On my 32 bit machine, enquire.c tells me that long integers have 32 bits of unsigned value. It also says that doubles have 53 bits of precision. So if you decide to use floats for money, you get bigger numbers than if you use long.

Oh, and might I suggest that you consider doing it in pennies rather than fractional dollars? It will work out better.

Better to understand the underlying territory, I think. That would not be over-engineering.