If I run the statement
Math.Exp(113.62826122038274).ToString("R")
on a machine with .net 4.5.1 installed, then I get the answer
2.2290860617259248E+49
However, if I run the same command on a machine with .net framework 4.5.2 installed, then I get the answer
2.2290860617259246E+49
(i.e. the final digit changes)
I realise that this is broadly insignificant in pure numeric terms, but does anyone know of any changes that have been made in .net 4.5.2 that would explain the change?
(I don't prefer one result to the other, I am just interested to understand why it has changed)
If I output
The input in roundtrip format
The input converted to a long via BitConverter.DoubleToInt64Bits
Math.Exp in roundtrip format
Math.Exp converted to a long via BitConverter.DoubleToInt64Bits
then on 4.5.1 I get
113.62826122038274
4637696294982039780
2.2290860617259248E+49
5345351685623826106
and on 4.5.2 I get:
113.62826122038274
4637696294982039780
2.2290860617259246E+49
5345351685623826105
So for the exact same input, I get a different output (as can be seen from the bits so no roundtrip formatting is involved)
More details:
Compiled once using VS2015
Both machines that I am running the binaries on are 64bit
One has .net 4.5.1 installed, the other 4.5.2
Just for clarity: the string conversion is irrelevant... I get the change in results regardless of whether string conversion is involved. I mentioned that purely to demonstrate the change.