, := false, falseif < 0 {
= -
= true
}
varuint64var , float64if >= reduceThreshold {
, = trigReduce()
} else {
= uint64( * (4 / Pi)) // integer part of x/(Pi/4), as integer for tests on the phase angle
= float64() // integer part of x/(Pi/4), as floatif &1 == 1 { // map zeros to origin
++
++
}
&= 7// octant modulo 2Pi radians (360 degrees)
= (( - *) - *) - * // Extended precision modular arithmetic
}
if > 3 { // reflect in x axis
-= 4
, = !, !
}
if > 1 {
= !
}
:= *
= 1.0 - 0.5* + **((((((_cos[0]*)+_cos[1])*+_cos[2])*+_cos[3])*+_cos[4])*+_cos[5])
= + **((((((_sin[0]*)+_sin[1])*+_sin[2])*+_sin[3])*+_sin[4])*+_sin[5])
if == 1 || == 2 {
, = ,
}
if {
= -
}
if {
= -
}
return
The pages are generated with Goldsv0.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.