I've been trying to figure out how to parse double in .NET Micro Framework (.NETMF) with the same precision as in normal .NET framework.
When I do this in classic .NET framework:
Debug.Print(Double.Parse("4213238").ToString());
I get expected output, 4213238.
But when I do the same thing in .NETMF I get the non-precise output 4213238.0000000009. The size of double is 8 bytes in the both .NET framework implementations. What do I need to do to make the .NETMF Double.Parse work the same way as normal .NET framework Double.Parse?
Is there a better way than to write a parser-method for this?
I get non-precise output 4213238.0000000009
No, that's precise. Double can store 15 significant digits. Count them off, you got them all. The rest are just random noise digits whose value is affected by the floating point hardware implementation. Your MF target has different hardware. There's no available magic to get more without picking another type, just displaying less digits takes no magic. Int or long would of course be an excellent choice, they are very precise.