Source File
int.go
Belonging Package
math/big
package big
import (
)
switch {
func ( *Int) () uint {
return .abs.trailingZeroBits()
}
func ( *Int) (, , , *Int) *Int {
if len(.abs) == 0 || len(.abs) == 0 {
, , , := len(.abs), len(.abs), .neg, .neg
if == 0 {
.Set()
} else {
.Set()
}
.neg = false
if != nil {
if == 0 {
.SetUint64(0)
} else {
.SetUint64(1)
.neg =
}
}
if != nil {
if == 0 {
.SetUint64(0)
} else {
.SetUint64(1)
.neg =
}
}
return
}
return .lehmerGCD(, , , )
}
, , = 0, 1, 0
, , = 0, 0, 1
for >= && - >= + {
, := /, %
, = ,
, , = , , +*
, , = , , +*
= !
}
return
}
, , , , := lehmerSimulate(, )
lehmerUpdate(, , , , , , , , , , )
lehmerUpdate(, , , , , , , , , , )
}
euclidUpdate(, , , , , , , , )
}
}
euclidUpdate(, , , , , , , , )
}
if == {
.Set()
} else {
=
:= .abs.trailingZeroBits()
if &1 != 0 {
:= .abs[0] & 7
if == 3 || == 5 {
= -
}
}
.Rsh(&, ) // a = 2^s*c
return .modSqrt3Mod4Prime(, )
return .modSqrt5Mod8Prime(, )
return .modSqrtTonelliShanks(, )
}
}
if .neg {
, = , // & is symmetric
}
if .neg {
, = , // | is symmetric
}
if .neg {
, = , // ^ is symmetric
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |