Skip to content

Commit 274f8d2

Browse files
committed
refactor: replace hardcoded EULER_GAMMA with std::f64::consts::EULER_GAMMA
ocr_felt.rs had a truncated literal (0.5772156649 — 10 digits vs the full 16). Switching to std::f64::consts::EULER_GAMMA (Rust 1.94+) fixes the precision and eliminates the hardcoded constant. https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A
1 parent 7caefe9 commit 274f8d2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hpc/ocr_felt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
1212
use super::ocr_simd::{BinaryImage, GrayImage, foreground_count};
1313

14-
/// Euler-Mascheroni constant.
15-
const EULER_GAMMA: f64 = 0.5772156649;
14+
/// Euler-Mascheroni constant (Rust 1.94+).
15+
const EULER_GAMMA: f64 = std::f64::consts::EULER_GAMMA;
1616
/// Signal floor for skew detection: γ/(γ+1).
1717
const SKEW_FLOOR: f64 = EULER_GAMMA / (EULER_GAMMA + 1.0);
1818

0 commit comments

Comments
 (0)