On MIPS: # python3.5 -c 'print(10.0**20)' 1.0000000000000036e+20 While a simple C testcase works fine: #include <math.h> #include <stdio.h> int main() { double src = 10.0; double p = 20; printf("%lf\n", pow(src, p)); } BUT only if at least -O1 or -Os is applied (with -O0 or no -O option it gives a similar 36 containing value). Given that libm pow() works correctly with -Os, -O1, -O2 and event -Ofast, I don't understand how python is getting it wrong. Additionally this can be observed with python2.7: Python 2.7.13 (default, Apr 19 2017, 12:32:15) [GCC 5.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 10.0**20 1.0000000000000036e+20 >>> print(10.0**20) 1e+20 while for python3.5 and python3.6 it gives 1.0000000000000036e+20 for both cases. This all causes dev-python/Babel tests to fail from https://github.com/python-babel/babel/blob/master/tests/test_numbers.py#L34 with python3 (interestingly they seem to pass with python2.7, perhaps due to the above mentioned mystery somehow).
everything behaves the same when using pow(10.0, 20) in place of 10.0**20, including the 2.7 oddity
Someone with MIPS hardware will need to fix this. As far as I know, the problem does not occur on other archs.
# python3.5 -c 'print(10.0**20)' 1e+20 And Babel's tests pass for me on both my Yeeloong and my Loongson3A.