@@ -9,9 +9,9 @@ pub(crate) const NANOS_PER_SEC: u64 = 1_000_000_000;
99// Re-export float constants with appropriate precision for the Float type.
1010// This centralizes all cfg gating for constants in one place.
1111#[ cfg( not( feature = "64bit" ) ) ]
12- pub use std:: f32:: consts:: { E , LN_2 , LN_10 , LOG2_10 , LOG2_E , LOG10_2 , LOG10_E , PI , TAU } ;
12+ pub use std:: f32:: consts:: { E , LN_10 , LN_2 , LOG10_2 , LOG10_E , LOG2_10 , LOG2_E , PI , TAU } ;
1313#[ cfg( feature = "64bit" ) ]
14- pub use std:: f64:: consts:: { E , LN_2 , LN_10 , LOG2_10 , LOG2_E , LOG10_2 , LOG10_E , PI , TAU } ;
14+ pub use std:: f64:: consts:: { E , LN_10 , LN_2 , LOG10_2 , LOG10_E , LOG2_10 , LOG2_E , PI , TAU } ;
1515
1616/// Linear interpolation between two samples.
1717///
@@ -255,21 +255,21 @@ mod test {
255255 #[ test]
256256 fn convert_linear_to_decibels ( ) {
257257 // Test the inverse conversion function using the same reference data
258- for ( wikipedia_db , linear) in DECIBELS_LINEAR_TABLE {
258+ for ( expected_db , linear) in DECIBELS_LINEAR_TABLE {
259259 let actual_db = linear_to_db ( linear) ;
260260
261261 // Sanity check: ensure we're reasonably close to the expected dB value from the table
262262 // This accounts for rounding in both the linear and dB reference values
263- let magnitude_ratio = if wikipedia_db . abs ( ) > 10.0 * Float :: EPSILON {
264- actual_db / wikipedia_db
263+ let magnitude_ratio = if expected_db . abs ( ) > 10.0 * Float :: EPSILON {
264+ actual_db / expected_db
265265 } else {
266266 1.0 // Skip ratio check for values very close to 0 dB
267267 } ;
268268
269- if wikipedia_db . abs ( ) > 10.0 * Float :: EPSILON {
269+ if expected_db . abs ( ) > 10.0 * Float :: EPSILON {
270270 assert ! (
271271 magnitude_ratio > 0.99 && magnitude_ratio < 1.01 ,
272- "Result differs significantly from table reference for linear {linear}: expected {wikipedia_db }dB, got {actual_db}dB, ratio: {magnitude_ratio:.4}"
272+ "Result differs significantly from table reference for linear {linear}: expected {expected_db }dB, got {actual_db}dB, ratio: {magnitude_ratio:.4}"
273273 ) ;
274274 }
275275 }
0 commit comments