-
Notifications
You must be signed in to change notification settings - Fork 21
/
double.go
46 lines (31 loc) · 930 Bytes
/
double.go
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
package cwl
import (
"fmt"
"strconv"
)
type Double float64
func (i *Double) Is_CWL_object() {}
func (i *Double) GetClass() string { return string(CWL_double) } // for CWL_object
func (i *Double) GetType() CWLType_Type { return CWL_double }
func (i *Double) String() string { return strconv.FormatFloat(float64(*i), 'f', -1, 64) }
func (i *Double) GetId() string { return "" }
func (i *Double) SetId(x string) {}
func (i *Double) Is_CWL_minimal() {}
func NewDoubleFromfloat64(value float64) (i *Double) {
var i_nptr Double
i_nptr = Double(value)
i = &i_nptr
return
}
func NewDouble(value float64) *Double {
return NewDoubleFromfloat64(value)
}
func NewDoubleFromInterface(native interface{}) (i *Double, err error) {
real_float64, ok := native.(float64)
if !ok {
err = fmt.Errorf("(NewDoubleFromInterface) Cannot create float64")
return
}
i = NewDoubleFromfloat64(real_float64)
return
}