aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/slime/double_value.go
blob: d8c3162618413237700da3ec401e942ccf13a626 (plain) (blame)
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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej

package slime

type DoubleValue struct {
	valueBase
	v float64
}

func newDoubleValue(value float64) *DoubleValue {
	return &DoubleValue{v: value}
}

func (d *DoubleValue) Valid() bool {
	return true
}

func (d *DoubleValue) AsDouble() float64 {
	return d.v
}

func (d *DoubleValue) AsLong() int64 {
	return int64(d.v)
}

func (d *DoubleValue) Type() Type {
	return DOUBLE
}