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

3 ビュー (過去 30 日間)
Songbai Jin
Songbai Jin 2022 年 5 月 5 日
コメント済み: Songbai Jin 2022 年 5 月 6 日
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!

採用された回答

David Hill
David Hill 2022 年 5 月 5 日
編集済み: David Hill 2022 年 5 月 5 日
x=sym('23');
mod(factorial(x),10000)
x=sym('24');
mod(factorial(x),10000)
  1 件のコメント
Songbai Jin
Songbai Jin 2022 年 5 月 6 日
Thanks for your answer. I'd really appreciate it if you could help with the other two similar questions I've asked.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by