algorithm

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigGcd

func BigGcd(a, b *big.Int) *big.Int

BigGcd Euclid algorithm calculates the greatest common divisor of two big integers. 欧几里得算法 计算两个大整数的最大公约数

func BinPow

func BinPow(base, exponent uint64) uint64

BinPow 快速幂 迭代版本

func CRT

func CRT(k int, a, r []int) int64

CRT 中国剩余定理

func ExGcd

func ExGcd(a, b int64) (gcd, x1, y1 int64)

ExGcd 扩展欧几里得算法

func ExGcdBig

func ExGcdBig(a, b *big.Int) (gcd, x, y *big.Int)

ExGcdBig 扩展欧几里得算法 Big Int 版本

func ExGcdR

func ExGcdR(a, b int64) (int64, int64, int64)

ExGcdR 扩展欧几里得算法 递归版本

func Gcd

func Gcd(a, b int64) int64

Gcd Euclid algorithm 欧几里得算法

func ModInverse

func ModInverse(a, m int64) (int64, error)

ModInverse 计算模逆元

func SteinGcd

func SteinGcd(a, b *big.Int) *big.Int

SteinGcd calculates the greatest common divisor of two big integers using the Stein algorithm. 使用 Stein 算法计算最大公约数

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL