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

Function simple_aggregate

nodedb/src/engine/timeseries/columnar_agg.rs:392–402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

390
391 #[test]
392 fn simple_aggregate() {
393 let values = [1.0, 2.0, 3.0, 4.0, 5.0];
394 let result = aggregate_f64(&values);
395 assert_eq!(result.count, 5);
396 assert!((result.sum - 15.0).abs() < f64::EPSILON);
397 assert!((result.min - 1.0).abs() < f64::EPSILON);
398 assert!((result.max - 5.0).abs() < f64::EPSILON);
399 assert!((result.avg() - 3.0).abs() < f64::EPSILON);
400 assert!((result.first - 1.0).abs() < f64::EPSILON);
401 assert!((result.last - 5.0).abs() < f64::EPSILON);
402 }
403
404 #[test]
405 fn kahan_accuracy() {

Callers

nothing calls this directly

Calls 1

aggregate_f64Function · 0.85

Tested by

no test coverage detected