For example, Convert.ToDouble("0.1234567890123456789") = 0.123456789012346
What is the maximum number of significant figures? Couldn't find it in the docs.
For example, Convert.ToDouble("0.1234567890123456789") = 0.123456789012346
What is the maximum number of significant figures? Couldn't find it in the docs.
Of course there's a maximum precision. It's the maximum that you can express with the bits used to store the double. For that string you might try Decimal instead.
If you really want to understand binary representation of floating point numbers, see IEEE 754-1985 on Wikipedia.
Basically, it's
sign * 1.mantissa * 2^(exponent - bias)
The number of bits allocated to the mantissa and exponent fields determines the precision of the number.
http://en.wikipedia.org/wiki/Double_precision
A double only has 64 bits of storage, and some of them are used for the sign and exponent, so there are a limited number of digits (usually 15) for the fractional part. A float has only 32 bits, so 8-9 digits of precision. Also some numbers cannot be represented exactly using a floating point number so you may see some rounding errors in your conversions.