Source File
complex.go
Belonging Package
runtime
package runtime
func ( float64) float64 {
:= 0.0
if isInf() {
= 1.0
}
return copysign(, )
}
func ( complex128, complex128) complex128 {
var , float64 // complex(e, f) = n/m
, := real(), imag()
, := real(), imag()
switch {
case == 0 && (!isNaN() || !isNaN()):
= copysign(inf, ) *
= copysign(inf, ) *
case (isInf() || isInf()) && isFinite() && isFinite():
= inf2one()
= inf2one()
= inf * (* + *)
= inf * (* - *)
case (isInf() || isInf()) && isFinite() && isFinite():
= inf2one()
= inf2one()
= 0 * (* + *)
= 0 * (* - *)
}
}
return complex(, )
![]() |
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. |