Problems when 'mod' quite big number (like factorial).

2 vues (au cours des 30 derniers jours)
Songbai Jin
Songbai Jin le 5 Mai 2022
Commenté : Songbai Jin le 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!

Réponse acceptée

David Hill
David Hill le 5 Mai 2022
Modifié(e) : David Hill le 5 Mai 2022
x=sym('23');
mod(factorial(x),10000)
x=sym('24');
mod(factorial(x),10000)
  1 commentaire
Songbai Jin
Songbai Jin le 6 Mai 2022
Thanks for your answer. I'd really appreciate it if you could help with the other two similar questions I've asked.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by