package runtime
func ( float64) float64 {
:= 0.0
if isInf() {
= 1.0
}
return copysign(, )
}
func ( complex128, complex128) complex128 {
var , float64
if abs(real()) >= abs(imag()) {
:= imag() / real()
:= real() + *imag()
= (real() + imag()*) /
= (imag() - real()*) /
} else {
:= real() / imag()
:= imag() + *real()
= (real()* + imag()) /
= (imag()* - real()) /
}
if isNaN() && isNaN() {
, := 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(, )
}