Why does GCC implement isnan() more efficiently for C++ than C ?

Looking at <cmath> for libstdc++ shipped with gcc 4.9 you get this: constexpr bool isnan(double __x) { return __builtin_isnan(__x); } A constexpr function could be aggressively inlined and, of course, the function just delegates the work over to __builtin_isnan. The <math.h> header doesn’t use __builtin_isnan, rather it uses an __isnan implementation which is kind of … Read more

Why 0.1 + 0.2 == 0.3 in D?

(Flynn’s answer is the correct answer. This one addresses the problem more generally.) You seem to be assuming, OP, that the floating-point inaccuracy in your code is deterministic and predictably wrong (in a way, your approach is the polar opposite of that of people who don’t understand floating point yet). Although (as Ben points out) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)