From MSDN:
A decimal number is a signed, fixed-point value consisting of an integral part and an optional fractional part. The integral and fractional parts consist of a series of digits that range from zero to nine (0 to 9), separated by a decimal point symbol.
I thought it was a floating point number with base 10.
A fixed point (sometimes shortened to fixpoint, also known as an invariant point) is a value that does not change under a given transformation. Specifically, in mathematics, a fixed point of a function is an element that is mapped to itself by the function.
Decimal Fixed-Point RepresentationFixed-point representation has a radix point known as decimal point. Fixed-point numbers having decimal points at the right end of the number are treated as integers because the fixed-point numbers having decimal points at the left end of the number are treated as fractions.
Fixed point numbers are numbers for which there is a fixed location of the point separating integers from fractional numbers. Thus, 15.3 is an example of a denary fixed point number, 1010.1100 an example of a fixed point binary number, and DE. 2A an example of a fixed point hexadecimal number.
Yes, it is a floating point number. That's very old documentation - it was fixed in the .NET 2.0 docs.
(It's unclear whether this was due to me submitting a correction or whether other people had as well. I do remember having to justify my position time and time again, where I thought it was pretty clear - if Decimal
was a fixed point type, why did each value include an exponent? I also remember having arguments in C# newsgroups about this, where people were clinging to the documentation as evidence that it really was a fixed point type. Oh well.)
I think it's because you're looking at the .NET 1.1 version of Decimal. The 3.5 version states:
A decimal number is a floating-point value that consists of a sign, a numeric value where each digit in the value ranges from 0 to 9, and a scaling factor that indicates the position of a floating decimal point that separates the integral and fractional parts of the numeric value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With