summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-26 20:13:07 +0100
committersalmonik <salmonik@tuta.io>2026-10-26 20:13:07 +0100
commit300e7bc03b80dd4bac61330817bf6d9f04d4231b (patch)
tree7c35877edc58dae47045c33f8e1ff39182ab67cf /src/hl2h.h
parentFonts: bundle Liberation Sans and register it with fontconfig (diff)
downloadhl2h-300e7bc03b80dd4bac61330817bf6d9f04d4231b.tar.gz
hl2h-300e7bc03b80dd4bac61330817bf6d9f04d4231b.zip
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
Diffstat (limited to '')
-rw-r--r--src/hl2h.h5
1 files changed, 5 insertions, 0 deletions
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 @@
11#include <pthread.h> 11#include <pthread.h>
12#include <unistd.h> 12#include <unistd.h>
13 13
14// Shared float-precision constant. More digits than a float can hold are
15// rounded at compile time and have no runtime cost; a coarse value would only
16// hurt angular accuracy, never performance.
17constexpr float PI_F = 3.14159265f;
18
14// --------------------------------------------------------------------------- 19// ---------------------------------------------------------------------------
15// logging 20// logging
16// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------