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

Function decimal_values_two_digits

nodedb-codec/src/alp.rs:444–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

442
443 #[test]
444 fn decimal_values_two_digits() {
445 // Values like 99.99 — exponent=2, factor=100.
446 let values: Vec<f64> = (0..1000).map(|i| i as f64 * 0.01).collect();
447 let encoded = encode(&values);
448 let decoded = decode(&encoded).unwrap();
449 for (i, (a, b)) in values.iter().zip(decoded.iter()).enumerate() {
450 assert_eq!(a.to_bits(), b.to_bits(), "mismatch at {i}: {a} vs {b}");
451 }
452 }
453
454 #[test]
455 fn typical_cpu_metrics() {

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
encodeFunction · 0.70
decodeFunction · 0.70
iterMethod · 0.45

Tested by

no test coverage detected