|
|
|
|
|
by nortiero
3406 days ago
|
|
I think that this is a case of mismatch between two standards, not a bug. The C standard allows higher precision values to be used in place of lesser ones (extended precision vs double) and REQUIRES conversion to the correct precision during assignment (or casting).
Also, the C abstract machine has the option to store those values when/if it deems opportune, it won't change observables as defined there. On the other side, IEEE 754 allows extended precision to be used in place of double and of course requires that any chosen precision be kept or else. But C Standard mandates IEEE 754 , too! It seems to me that modern C deliberately chose to ignore such kind of mismatch in the name of (substantial) performance gains. K&R, good or bad, was way simpler! |
|
Are you sure? I can't find it in the standard, specifically not in [1] page 28., section 5.2.4.2.2.
[1] (the final draft of C1X, dated 12 April 2011) http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf