Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Associative property with DBL_MAX and DBL_MIN?
Asked
Oct 07 '17 at 18:34
Active
Oct 07 '17 at 18:34
Viewed
11 times
0
Can someone explain me why is this happening:
1+2+DBL_MAX-DBL_MIN = 0 and 1+DBL_MAX-DBL_MIN+2=3?
c
double
asked Oct 07 '17 at 18:34
Ninalol
45
7
because in the float point arithmetics a + b + c does not have to be equal to c + b + a and you have the UB here as well - so any result is good.
–
0___________
Oct 07 '17 at 18:41
What does it mean UB?
–
Ninalol
Oct 07 '17 at 19:59
0 Answers
0