C# which is the best data type for precision 3?

.net, c#, precision, types

Solution

The `decimal` type is the best for fixed point math.

From the C# Spec Section 4.1.7:

Contrary to the float and double data types, decimal fractional numbers such as 0.1 can be represented exactly in the decimal representation. In the float and double representations, such numbers are often infinite fractions, making those representations more prone to round-off errors.

Problem

I want to store a number with the following 0.000 which is the best data type to use. A double? Also I guess an INT is just out of the question?

Original source