MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / f64_special_values

Function f64_special_values

nodedb-codec/src/pcodec.rs:214–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212
213 #[test]
214 fn f64_special_values() {
215 let values = vec![0.0, -0.0, f64::INFINITY, f64::NEG_INFINITY, 1.0, -1.0];
216 let encoded = encode_f64(&values).unwrap();
217 let decoded = decode_f64(&encoded).unwrap();
218 for (a, b) in values.iter().zip(decoded.iter()) {
219 assert_eq!(a.to_bits(), b.to_bits());
220 }
221 }
222
223 #[test]
224 fn truncated_errors() {

Callers

nothing calls this directly

Calls 3

encode_f64Function · 0.70
decode_f64Function · 0.70
iterMethod · 0.45

Tested by

no test coverage detected