About

I am a software developer in Seattle, building a new AI software company.

Ads

August 2009

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Ads


« Miguel and Avalon | Main | Feed Problems »

August 14, 2006

Comments

RichB

Whenever I work in a field which requires currency calculations, I represent the currency with a Decimal data type.

More often than not, I find team members, or the existing codebase to have used double...

So I suspect that in banks everyone should be using something at least as good as a decimal data type and therefore it's more common than you think.

Strange that 0.9999 recurring isn't treated as 1.0 by the Decimal data type - as you pointed to a couple of months ago, they are synonymous.

Wesner Moise

Another major reason why I have a more exact numeric data type is to make numbers more easily hashable. Numbers that arise in calculations tend to be close but not always exact.

Barry Kelly

I'm sure you mean to say 16 bytes, not 16-bit, no?

Wesner Moise

I forget to point out that division may actually behave better with doubles than with decimals. (1d/3d)*3d will actually equate to 1d.

The comments to this entry are closed.