Modulus Arithmetic Function Not Working

2 ビュー (過去 30 日間)
Nicholas Dalton
Nicholas Dalton 2021 年 10 月 21 日
コメント済み: Nicholas Dalton 2021 年 10 月 21 日
I'm trying to use the function rem() to determine the remainder of some modulus arithmetic equation, however my implementation doesn't seem to work. The equation in question is: . The correct answer should be but when I try solving it with the rem() function I get an unexpected answer. What am I doing wrong?
>> r=rem(715^17,2773)
r =
2089
>>
I checked the original equation using Wolframalpha and it does give me the answer I was expecting:

採用された回答

Chunru
Chunru 2021 年 10 月 21 日
715^17 is too big. You can use symbolic computation:
r=rem(sym(715)^17,2773)
r = 
1462
  1 件のコメント
Nicholas Dalton
Nicholas Dalton 2021 年 10 月 21 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by