Cannot get mod to return correct value
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Eugene Browder
il 16 Lug 2020
Commentato: Eugene Browder
il 16 Lug 2020
I am trying to solve:
3^233 mod(353).
In Matlab, mod(3^233,353) = 92
But the correct answer is 248.
Is the number to large? Is this a configuration issue? Is there not enough digits being kept for the calculation? Do I need to do this another way?
Thank you.
0 Commenti
Risposta accettata
Fangjun Jiang
il 16 Lug 2020
3^233 is an integer. Its value is roughly 1.5e111. So it needs 112 digits to record the integer value accurately. Double-precision data can't do that. I don't think MATLAB is the right tool for this.
Più risposte (1)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!