mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-08-18 00:43:00 +02:00
Fix float precision
This commit is contained in:
2
float.go
2
float.go
@@ -9,7 +9,7 @@ import (
|
|||||||
// This program uses NaN as a signal for missing data.
|
// This program uses NaN as a signal for missing data.
|
||||||
// For the HTTP JSON API to be able to handle NaN values,
|
// For the HTTP JSON API to be able to handle NaN values,
|
||||||
// we have to use our own type which implements encoding/json.Marshaler itself.
|
// we have to use our own type which implements encoding/json.Marshaler itself.
|
||||||
type Float float32
|
type Float float64
|
||||||
|
|
||||||
var NaN Float = Float(math.NaN())
|
var NaN Float = Float(math.NaN())
|
||||||
var nullAsBytes []byte = []byte("null")
|
var nullAsBytes []byte = []byte("null")
|
||||||
|
Reference in New Issue
Block a user