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

2 views (last 30 days)
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!

Accepted Answer

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

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!