big numbers in matlab / sym math tool
Show older comments
I have a problem using very big numbers in matlab. For example, i want to calculate 26^29.
Without Sym Math Tool i get 1.081999577417210e+41, or with Sym Maths Tool 108199957741720993031339765987128356372480. If i try to find its value in modulus 35, i get mod(26^29,35)=20.
When i use wolframalpha, i get 108199957741720996894562347292921981566976, and the modulus value 31, which is correct!
In matlab, if i subtract the wolfram's correct value from 26^29, the result is 0!
I am doing this as a simulation of Euler's totient theorem, and i banged my head around it for a while until it became obvious that there is an error in matlab.
Is there any way to bypass this error, and what can be the source of it?
Accepted Answer
More Answers (0)
Categories
Find more on Elementary Math in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!