为什么我使用大整数 (System.Numerics) 会出现系统溢出?

问题描述

我收到此错误: System.OverflowException: '值不是数字。' 我的印象是大整数可以存储任何大小的值(在这种情况下为 500 ^ 500),所以我不明白为什么会发生这种情况。

public int decode(int code)
{
   int totient = (p - 1) * (q - 1);
   int d = modInverse(e,totient);
   int pq = p * q;
   BigInteger decodedMessage = new BigInteger(Math.Pow(code,d) % pq);
   return (int)decodedMessage;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)