MathTop

modular_square_root 函数

在存在解时返回 a 关于模 m 的一个平方根。

语法

  • NumberTheory:-ModularSquareRoot(a, m)
  • ModularSquareRoot(a, m)
  • modular_square_root(a, m)

参数与选项

a目标剩余类。
m正模数。

示例

  1. 一个模平方根ModularSquareRoot(10, 13)返回 6。
  2. 包调用形式NumberTheory:-ModularSquareRoot(10, 13)返回 6。