Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is .NET “double” arithmetic independent of platform/architecture?

Tags:

c#

.net

If I run a complex calculation involving System.Double on .NET under Windows (x86 and x64) and then on Mono (Linux, Unix, whatever), am I absolutely guaranteed to get exactly the same result in all cases, or does the specification allow for some leeway in the calculation?

like image 625
Timwi Avatar asked Feb 16 '11 14:02

Timwi


1 Answers

From MSDN

In addition, the loss of precision that results from arithmetic, assignment, and parsing operations with Double values may differ by platform. For example, the result of assigning a literal Double value may differ in the 32-bit and 64-bit versions of the .NET Framework

Hope that helps.

like image 84
Bala R Avatar answered Oct 17 '22 09:10

Bala R