Cannot get mod to return correct value

1 次查看(过去 30 天)
I am trying to solve:
3^233 mod(353).
In Matlab, mod(3^233,353) = 92
But the correct answer is 248.
Is the number to large? Is this a configuration issue? Is there not enough digits being kept for the calculation? Do I need to do this another way?
Thank you.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2020-7-16
3^233 is an integer. Its value is roughly 1.5e111. So it needs 112 digits to record the integer value accurately. Double-precision data can't do that. I don't think MATLAB is the right tool for this.
  1 个评论
Eugene Browder
Eugene Browder 2020-7-16
Thank you for responding. I was trying to find the max values that could be used. Especially for the mod function.

请先登录,再进行评论。

更多回答(1 个)

jonas
jonas 2020-7-16

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by