2 ms·
Another weird thing about your C code is that is uses "long double" as argument and return types; but pow() and log() functions use doubles, so there's some une
by jwilk 9y ago
Another weird thing about your C code is that is uses "long double" as argument and return types; but pow() and log() functions use doubles, so there's some unexpected rounding going on.
Possible ways to fix that:
- Use the "double" type everywhere.
- Use powl() and logl() functions instead.
- Use tgmath.h instead of math.h. (But when I tried this with GCC 7 + glibc 2.27, the compiler ran out of memory. Go figure…)
- Use C++, which has overloads for pow() and log().