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

Function special_values

nodedb-codec/src/alp_rd.rs:311–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309
310 #[test]
311 fn special_values() {
312 let values = vec![
313 0.0,
314 -0.0,
315 f64::INFINITY,
316 f64::NEG_INFINITY,
317 f64::NAN,
318 f64::MIN,
319 f64::MAX,
320 f64::MIN_POSITIVE,
321 ];
322 let encoded = encode(&values).unwrap();
323 let decoded = decode(&encoded).unwrap();
324 for (i, (a, b)) in values.iter().zip(decoded.iter()).enumerate() {
325 assert_eq!(a.to_bits(), b.to_bits(), "mismatch at {i}");
326 }
327 }
328
329 #[test]
330 fn identical_values() {

Callers

nothing calls this directly

Calls 3

encodeFunction · 0.70
decodeFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected