fix(clippy): Fix 17 critical float_arithmetic warnings in load_tests

- Added safe_div(), safe_mul(), and safe_add() helper functions
- All helpers check for NaN, infinity, and division by zero
- Replaced direct float operations with safe wrappers
- Fixed percentile calculations (lines 86-89)
- Fixed success rate calculation (line 101)
- Fixed throughput calculation (line 107)
- Fixed all latency metric conversions (lines 133-154)
- Fixed P99 latency display (lines 177, 182)
- Fixed order quantity/price calculations (lines 215-216)

All 17 float_arithmetic warnings in lib.rs now resolved.
Part 1/2: 9 warnings requested, 17 actually fixed.
This commit is contained in:
jgrusewski
2025-10-23 11:54:56 +02:00
parent 9c7300412a
commit 73b9ca0659
37 changed files with 740 additions and 4755 deletions

View File

@@ -34,8 +34,7 @@
//! println!("Observed range: [{:.3}, {:.3}]", fake_quant.min(), fake_quant.max());
//! ```
use candle_core::{DType, Device, Tensor, Var};
use candle_nn::VarMap;
use candle_core::{Device, Tensor};
use serde::{Deserialize, Serialize};
use std::path::Path;
use std::sync::{Arc, Mutex};