Source File
sqrt.go
Belonging Package
math/big
switch % 2 {
.sqrtInverse()
return .SetMantExp(, /2)
}
:= newFloat(.prec)
:= newFloat(.prec)
:= three()
:= func( *Float) *Float {
.prec = .prec
.prec = .prec
.Mul(, ) // u = t²
.Mul(, ) // = xt²
.Sub(, ) // v = 3 - xt²
.Mul(, ) // u = t(3 - xt²)
.exp-- // = ½t(3 - xt²)
return .Set()
}
, := .Float64()
:= newFloat(.prec)
.SetFloat64(1 / math.Sqrt())
for := .prec + 32; .prec < ; {
.prec *= 2
= ()
.Mul(, )
}
![]() |
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. |