-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex128.go
More file actions
31 lines (26 loc) · 812 Bytes
/
complex128.go
File metadata and controls
31 lines (26 loc) · 812 Bytes
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
package pointerhelpers
// Complex128Helper contains all Complex128 related
// pointer helpers
type Complex128Helper struct {
}
// Complex128 returns a pointer to the complex128 value passed in.
func Complex128(v complex128) *complex128 {
return &v
}
// Complex128 returns a pointer to the complex128 value passed in.
func (i *Complex128Helper) Complex128(v complex128) *complex128 {
return Complex128(v)
}
// Complex128Value returns the value of the complex128 pointer passed in or
// 0 if the pointer is nil.
func Complex128Value(v *complex128) complex128 {
if v != nil {
return *v
}
return 0
}
// Complex128Value returns the value of the complex128 pointer passed in or
// 0 if the pointer is nil.
func (i *Complex128Helper) Complex128Value(v *complex128) complex128 {
return Complex128Value(v)
}