* README.Portability: Remove note on an Irix compatibility issue.
[official-gcc.git] / libgo / go / runtime / complex_test.go
blobf41e6a3570140cf71bbade054b7e5591b3ebc927
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package runtime_test
7 import (
8 "math/cmplx"
9 "testing"
12 var result complex128
14 func BenchmarkComplex128DivNormal(b *testing.B) {
15 d := 15 + 2i
16 n := 32 + 3i
17 res := 0i
18 for i := 0; i < b.N; i++ {
19 n += 0.1i
20 res += n / d
22 result = res
25 func BenchmarkComplex128DivNisNaN(b *testing.B) {
26 d := cmplx.NaN()
27 n := 32 + 3i
28 res := 0i
29 for i := 0; i < b.N; i++ {
30 n += 0.1i
31 res += n / d
33 result = res
36 func BenchmarkComplex128DivDisNaN(b *testing.B) {
37 d := 15 + 2i
38 n := cmplx.NaN()
39 res := 0i
40 for i := 0; i < b.N; i++ {
41 d += 0.1i
42 res += n / d
44 result = res
47 func BenchmarkComplex128DivNisInf(b *testing.B) {
48 d := 15 + 2i
49 n := cmplx.Inf()
50 res := 0i
51 for i := 0; i < b.N; i++ {
52 d += 0.1i
53 res += n / d
55 result = res
58 func BenchmarkComplex128DivDisInf(b *testing.B) {
59 d := cmplx.Inf()
60 n := 32 + 3i
61 res := 0i
62 for i := 0; i < b.N; i++ {
63 n += 0.1i
64 res += n / d
66 result = res