From 07275ecb5fd0bdd5845e18d806f59ec435a4315f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 3 Nov 2024 20:19:45 +0200 Subject: [PATCH] BAN: Implement floating point constants in Numbers.h --- BAN/include/BAN/Numbers.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 BAN/include/BAN/Numbers.h diff --git a/BAN/include/BAN/Numbers.h b/BAN/include/BAN/Numbers.h new file mode 100644 index 0000000000..9389e54c98 --- /dev/null +++ b/BAN/include/BAN/Numbers.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +namespace BAN::numbers +{ + + template inline constexpr T e_v = 2.71828182845904523536; + template inline constexpr T log2e_v = 1.44269504088896340736; + template inline constexpr T lge_v = 0.43429448190325182765; + template inline constexpr T lg2_v = 0.30102999566398119521; + template inline constexpr T ln2_v = 0.69314718055994530942; + template inline constexpr T ln10_v = 2.30258509299404568402; + template inline constexpr T pi_v = 3.14159265358979323846; + template inline constexpr T sqrt2_v = 1.41421356237309504880; + template inline constexpr T sqrt3_v = 1.73205080756887729353; + + inline constexpr double e = e_v; + inline constexpr double log2e = log2e_v; + inline constexpr double lge = lge_v; + inline constexpr double lg2 = lge_v; + inline constexpr double ln2 = ln2_v; + inline constexpr double ln10 = ln10_v; + inline constexpr double pi = pi_v; + inline constexpr double sqrt2 = sqrt2_v; + inline constexpr double sqrt3 = sqrt3_v; + +}