Associativity math: (a + b) + c != a + (b + c)
Recently I was going through an old blog post by Eric Lippert in which, while writing about associativity he mentions that in C#, (a + b) + c is not equivalent to a + (b + c) for certain values of a, b, c. I am not able to figure out for what types and range of arithmetic values might that hold true and why. On the range of the double type: double dbl1 = (double.MinValue + double.MaxValue) + double.MaxValue; double dbl2 = double.MinValue + (double.MaxValue + double.MaxValue); The first one is double.MaxValue , the second one is double.Infinity On the precision of the double type: double dbl1 =