Beispiel #1
0
func BenchmarkComplex128DivDisNaN(b *testing.B) {
	d := 15 + 2i
	n := cmplx.NaN()
	for i := 0; i < b.N; i++ {
		n += n / d
	}
	result = n
}
Beispiel #2
0
func BenchmarkComplex128DivNisNaN(b *testing.B) {
	d := cmplx.NaN()
	n := 32 + 3i
	for i := 0; i < b.N; i++ {
		n += n / d
	}
	result = n
}
Beispiel #3
0
func BenchmarkComplex128DivDisNaN(b *testing.B) {
	d := 15 + 2i
	n := cmplx.NaN()
	res := 0i
	for i := 0; i < b.N; i++ {
		d += 0.1i
		res += n / d
	}
	result = res
}
Beispiel #4
0
func main() {
	f := 3.2e5
	display(f)
	x := -7.3 - 8.9i
	display(x)
	y := complex64(-18.3 + 8.9i)
	display(y)
	z := complex(f, 13.2)
	display(z)
	display(real(y))
	display(imag(z))
	display(cmplx.Conj(z))
	display(cmplx.Inf())
	display(cmplx.NaN())
	display(cmplx.Sqrt(z))
}
Beispiel #5
0
// Return Nan for complex singleton.
func (A *FloatMatrix) Complex() complex128 {
	return cmplx.NaN()
}
Beispiel #6
0
func (O *BOpt) Complex() complex128 {
	return cmplx.NaN()
}