2 ms·
Have you checked the code produced by your compiler and standard library? I don't know of any which uses 80 bits mode. Unless you turn on the 80 bits yourself,
by acqq 14y ago
Have you checked the code produced by your compiler and standard library? I don't know of any which uses 80 bits mode. Unless you turn on the 80 bits yourself, you don't use them. If you find such compiler please write!
Another thing is that by the C standard, all calculations are performed on doubles, even when the result is to be stored as float. It's an ABC of C. :)
- emkemp 14y ago"all calculations are performed on doubles" is only true for traditional C. ANSI C permits single precision arithmetic if there are no double precision terms involved. Of course, C89 only provided standard math functions with double precision arguments, but C99 corrected that.
- acqq 14y agoYou are very correct, "permits." In practice the programmer must really be specific in the code, how he writes the constants (doubles are default) which functions he calls (doubles are default) and how he configures compiler (double intermediates were traditionally faster and defaults). There's a nice article on that topic: http://news.ycombinator.com/item?id=5138351 http://news.ycombinator.com/item?id=5138351 And it's just a part of the whole series of the nice FP articles.