News for hackers. Stuff that matters.
Re:Why does 0.1 and 0.2 = 0.30000000000000004? by vba616 on Wednesday February 08, 2023 @05:03PM (#34716013)
> If you design software that works with money amounts, always use fixed point decimals. Don't use floats, it's just wrong!

I find it funny the gap between what computer people think finance requires and actual practice.

The tax people in the US generally aren't interested in pennies any more! And when you use tax software that throws away the pennies before the final results, then your sums may very well not match the forms whose information is independently reported to the IRS, by well over a dollar. But nobody cares!

Re:Why does 0.1 and 0.2 = 0.30000000000000004? by sowbug on Wednesday February 08, 2023 @05:17PM (#34716257)
No need to invent a divide between "computer people" and "tax people," whoever they are. Maybe the IRS allows small errors because bugs attributable to floating-point precision are too hard to fix.
Re:Why does 0.1 and 0.2 = 0.30000000000000004? by jdmichal on Wednesday February 08, 2023 @05:59PM (#34716837)
AFAIK the IRS has always been accepting of truncating / rounding values to full dollars and discarding cents. It's certainly been that way for the decades that I've been doing taxes.
Re:Why does 0.1 and 0.2 = 0.30000000000000004? by jay_kyburz on Wednesday February 08, 2023 @11:22PM (#34719717)
In Australia the tax office doesn't event let you enter cents in online fields.
Re:Why does 0.1 and 0.2 = 0.30000000000000004? by vba616 on Friday February 10, 2023 @10:56PM (#34749435)
My point was that (at least some) standard US tax software rounds to dollars on intermediate results, apparently permitted and required by the IRS.

...while financial institutions send reports to clients and the IRS that have the totals rounded only at the end, meaning the things that are supposed to match don't and can't.

Even though they are both in dollars, they are not consistent even to the nearest dollar.