Problems when 'mod' quite big number (like factorial).
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Songbai Jin
am 5 Mai 2022
Kommentiert: Songbai Jin
am 6 Mai 2022
mod(factorial(22),10000)
mod(factorial(23),10000)
The answers should both be 0. However, the answers are 0 and 2864 seperately.
How to solve this problem?
Thank you very much!
0 Kommentare
Akzeptierte Antwort
David Hill
am 5 Mai 2022
Bearbeitet: David Hill
am 5 Mai 2022
x=sym('23');
mod(factorial(x),10000)
x=sym('24');
mod(factorial(x),10000)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Performance and Memory finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!