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

Function pi_multiples

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

Source from the content-addressed store, hash-verified

267
268 #[test]
269 fn pi_multiples() {
270 let values: Vec<f64> = (1..1000).map(|i| std::f64::consts::PI * i as f64).collect();
271 let encoded = encode(&values).unwrap();
272 let decoded = decode(&encoded).unwrap();
273 for (i, (a, b)) in values.iter().zip(decoded.iter()).enumerate() {
274 assert_eq!(a.to_bits(), b.to_bits(), "mismatch at {i}");
275 }
276 }
277
278 #[test]
279 fn scientific_data() {

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