From 300e7bc03b80dd4bac61330817bf6d9f04d4231b Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 20:13:07 +0100 Subject: Use one float-precision PI constant - move PI_F into hl2h.h as constexpr 3.14159265f and remove the duplicated long-double-style literals from hl2h.cpp/esp.cpp - extra digits are compile-time only; float operations cost the same --- src/hl2h.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index 37c849f..b86fe84 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -11,6 +11,11 @@ #include #include +// Shared float-precision constant. More digits than a float can hold are +// rounded at compile time and have no runtime cost; a coarse value would only +// hurt angular accuracy, never performance. +constexpr float PI_F = 3.14159265f; + // --------------------------------------------------------------------------- // logging // --------------------------------------------------------------------------- -- cgit v1.2.3