This is more robust than before, but there's probably a cleaner solution that I am missing..
2H6RJC35PGFYV7XDCQYOA45MU4GPJAEYHEJKP4KFZ3YIQVJP6WBAC assert_eq!(next_multiple, next_multiple.floor());let bucket_index = next_multiple as usize;
let float_error_margin = 2_f64.powf(1_f64 - (DECIMAL_PLACES as f64));assert!((next_multiple - next_multiple.round()).abs() <= float_error_margin);// assert_eq!(next_multiple, next_multiple.round());let bucket_index = (next_multiple.round()) as usize;
buckets[bucket_index] += 1;
if bucket_index == BUCKET_COUNT {// The max duration should be the only one in this final bucketassert_eq!(duration, max_duration);buckets[bucket_index - 1] += 1;} else {// Every other duration should hit this case insteadbuckets[bucket_index] += 1;}