News for hackers. Stuff that matters.
Re:Should I Use Signed or Unsigned Ints? (Part 2) by roel_v on Wednesday September 02, 2015 @05:14AM (#10158159)
I think I disagree (depending on what you mean exactly). You say

"That's why you use decimals, it's because they replicate the representation issues we are used to already so we don't even notice they are there, it's not that they are fundamentally better in any way."

So decimals are better, because they allow us to represent money amounts in the exact same way we do in real life, which is what we're modeling in software.

1/10 = 0.1, an amount you want to be able to represent in a computer. 1/3 = 0.33..., an amount (when talking about money) you don't want to represent (when we're talking about maintaining balances).

Unless you're saying "decimal as a concept is not philosophically or morally better than floating point", which is a position to which I suspect pretty much everybody subscribes.

Re:Should I Use Signed or Unsigned Ints? (Part 2) by emiliobumachar on Wednesday September 02, 2015 @09:12AM (#10158913)
I think gp's point is that 0.33... is "an amount (when talking about money) you don't want to represent (when we're talking about maintaining balances)" precisely because you, and everybody else, is so used to decimal that it disappears.

There's nothing intrinsic about 1/10 that makes it "rounder" than 1/3, except as an artifact of the numbering system.

Aliens with three hands with three fingers each, whose societies got used to base 9, would think 1/3 looks much "rounder", and 1/10 is the one you'd never want to represent.

Re:Should I Use Signed or Unsigned Ints? (Part 2) by roel_v on Thursday September 03, 2015 @03:47AM (#10163754)
No. It's not that a gum costs 5 cents because it's the only fraction of a dollar that can be represented in cents, it's because pricing is inherently done in one-cent increments. If there was a need to price single items at a lower-than-a-cent cost, or at prices between one-cent increments, and if the need for that outweighed the disadvantages, there would be a way to do it.

Other example: an apple doesn't cost 1/3 of a dollar, it costs 33 cents. The need for pricing things as a fraction is simply not there. I doubt most people would see 20 cents as '1/5 of a dollar' in the first place.

This might be a difference between people thinking in metric and thinking in imperial, too. (I'm metric, fwiw).

(before someone says 'I buy resistors that cost less than a cent', please show me a place that sells them individually)