11 lines
457 B
Plaintext
11 lines
457 B
Plaintext
func (s {{.Node.Name}}) {{.Field.Name|title}}() float{{.Bits}} {
|
|
{{template "_checktag" . -}}
|
|
return {{.G.Imports.Math}}.Float{{.Bits}}frombits(s.Struct.Uint{{.Bits}}({{.Offset}}){{with .Default}} ^ {{printf "%#x" .}}{{end}})
|
|
}
|
|
|
|
func (s {{.Node.Name}}) Set{{.Field.Name|title}}(v float{{.Bits}}) {
|
|
{{template "_settag" . -}}
|
|
s.Struct.SetUint{{.Bits}}({{.Offset}}, {{.G.Imports.Math}}.Float{{.Bits}}bits(v){{with .Default}}^{{printf "%#x" .}}{{end}})
|
|
}
|
|
|