
March 21, 2010
9:47 p.m.
Nick Coghlan wrote:
That's fine - binary floats *are* surprising. That's why Decimal exists in the first place.
This argument could equally well be used the other way -- someone using Decimal is doing so precisely because they *don't* want to be surprised, in which case they would probably prefer to get an exception. The fundamental problem here is that there are two possible reasons for a mixed float-decimal operation: 1) The user is thinking in terms of floats and has happened to get a Decimal mixed in somehow. 2) The user is thinking in terms of Decimals and has happened to get a float mixed in somehow. There is no way of distinguishing between these automatically. -- Greg