DecodeFloatDescending decodes floats encoded with EncodeFloatDescending.
(buf []byte)
| 87 | |
| 88 | // DecodeFloatDescending decodes floats encoded with EncodeFloatDescending. |
| 89 | func DecodeFloatDescending(buf []byte) ([]byte, float64, error) { |
| 90 | b, r, err := DecodeFloatAscending(buf) |
| 91 | if r != 0 && !math.IsNaN(r) { |
| 92 | // All values except for 0 and NaN were negated in EncodeFloatDescending, so |
| 93 | // we have to negate them back. Negative zero uses composite indexes to |
| 94 | // decode itself correctly. |
| 95 | r = -r |
| 96 | } |
| 97 | return b, r, err |
| 98 | } |
no test coverage detected
searching dependent graphs…