Can it guarantee the double value A/B is always equal to A/B?
问题 As we know, because of the limited precision of double, the following two calculation may not give the exact the same value : A / B / C and A / ( B * C ) My question is even with the same two variable, A & B, can the compiler guarantee every time A / B yield the same value ? Or I should ask in the code, can we guarantee the following statement always return true: If ( A / B == A / B ) 回答1: A guarantee of behavior for a compiler requires some document specifying the behavior. The answer