If I try 11^16 in matlab, I get: 45949729863572160
If I try 11**16 in python, I get: 45949729863572161
Notice, the last digits are different.
As the numbers get larger, the problem gets worse: 99^95 in Matlab: 3848960788934848|488282452569509484590776195611314554049114673132510910096787679715604422673797115451807631980373077374162416714994207463122539142978709403811688831410945323915071533162168320
99**95 in python: 3848960788934848|611927795802824596789608451156087366034658627953530148126008534258032267383768627487094610968554286692697374726725853195657679460590239636893953692985541958490801973870359499
Notice, where I placed the line, that's they begin to differ
the way I printed the numbers in MatlabŲ to control the precision:
num2str(99^95,1000)
the answer I am looking for is the python answer
Best Answer