File: example_test.go

package info (click to toggle)
gcc-riscv64-unknown-elf 8.3.0.2019.08%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680,956 kB
  • sloc: ansic: 3,237,715; cpp: 896,882; ada: 772,854; f90: 144,254; asm: 68,788; makefile: 67,456; sh: 29,743; exp: 28,045; objc: 15,273; fortran: 11,885; python: 7,369; pascal: 5,375; awk: 3,725; perl: 2,872; yacc: 316; xml: 311; ml: 285; lex: 198; haskell: 122
file content (91 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package math_test

import (
	"fmt"
	"math"
)

func ExampleAcos() {
	fmt.Printf("%.2f", math.Acos(1))
	// Output: 0.00
}

func ExampleAcosh() {
	fmt.Printf("%.2f", math.Acosh(1))
	// Output: 0.00
}

func ExampleAsin() {
	fmt.Printf("%.2f", math.Asin(0))
	// Output: 0.00
}

func ExampleAsinh() {
	fmt.Printf("%.2f", math.Asinh(0))
	// Output: 0.00
}

func ExampleAtan() {
	fmt.Printf("%.2f", math.Atan(0))
	// Output: 0.00
}

func ExampleAtan2() {
	fmt.Printf("%.2f", math.Atan2(0, 0))
	// Output: 0.00
}

func ExampleAtanh() {
	fmt.Printf("%.2f", math.Atanh(0))
	// Output: 0.00
}

func ExampleCos() {
	fmt.Printf("%.2f", math.Cos(math.Pi/2))
	// Output: 0.00
}

func ExampleCosh() {
	fmt.Printf("%.2f", math.Cosh(0))
	// Output: 1.00
}

func ExampleSin() {
	fmt.Printf("%.2f", math.Sin(math.Pi))
	// Output: 0.00
}

func ExampleSincos() {
	sin, cos := math.Sincos(0)
	fmt.Printf("%.2f, %.2f", sin, cos)
	// Output: 0.00, 1.00
}

func ExampleSinh() {
	fmt.Printf("%.2f", math.Sinh(0))
	// Output: 0.00
}

func ExampleTan() {
	fmt.Printf("%.2f", math.Tan(0))
	// Output: 0.00
}

func ExampleTanh() {
	fmt.Printf("%.2f", math.Tanh(0))
	// Output: 0.00
}

func ExampleSqrt() {
	const (
		a = 3
		b = 4
	)
	c := math.Sqrt(a*a + b*b)
	fmt.Printf("%.1f", c)
	// Output: 5.0
}