float equality
Sean Kelly
sean at invisibleduck.org
Wed Feb 23 07:28:57 PST 2011
Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> On 2/21/11 6:08 PM, bearophile wrote:
>> Andrei Alexandrescu:
>>
>>> This is a long-standing myth. I worked on Wall Street and have friends
>>> who have been doing it for years. Everybody uses double.
>>
>> Unbrutal Python programmers are encouraged to avoid the float type to
>> manage money values, and use decimal instead:
>> http://docs.python.org/library/decimal.html
>>
>> Bye,
>> bearophile
>
> ... and nobody uses Python :o).
C/C++, Visual Basic, and SQL in my experience. Though in SQL they may use
the 'money' type. Using double really isn't an issue so long as rounding is
handled appropriately. It seems like a lot of the trouble stems from people
thinking values must be naturally exactly represented by the storage type.
More information about the Digitalmars-d
mailing list