I have noticed that the conversion from double
to long
changes the value when the number to be converted is large, even if it is well below the max value of a long
.
For example, does someone can explain me why this conversion does not work as expected:
Convert.ToInt64(600000000000040000d)
// Return => 600000000000039936
Convert.ToInt64(600000000000040000L)
// Return => 600000000000040000
This cause some trouble in my formulas... Thanks.