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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user