3 // Copyright 2021 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
13 type Complex interface {
14 ~complex64 | ~complex128
17 func zero[T Complex]() T {
20 func pi[T Complex]() T {
23 func sqrtN1[T Complex]() T {
28 fmt.Println(zero[complex128]())
29 fmt.Println(pi[complex128]())
30 fmt.Println(sqrtN1[complex128]())
31 fmt.Println(zero[complex64]())
32 fmt.Println(pi[complex64]())
33 fmt.Println(sqrtN1[complex64]())