1// Copyright 2016 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.
4
5// +build ignore
6
7package cmplx_test
8
9import (
10	"fmt"
11	"math"
12	"math/cmplx"
13)
14
15func ExampleAbs() {
16	fmt.Printf("%.1f", cmplx.Abs(3+4i))
17	// Output: 5.0
18}
19
20// ExampleExp computes Euler's identity.
21func ExampleExp() {
22	fmt.Printf("%.1f", cmplx.Exp(1i*math.Pi)+1)
23	// Output: (0.0+0.0i)
24}
25
26func ExamplePolar() {
27	r, theta := cmplx.Polar(2i)
28	fmt.Printf("r: %.1f, θ: %.1f*π", r, theta/math.Pi)
29	// Output: r: 2.0, θ: 0.5*π
30}
31