summaryrefslogtreecommitdiff
path: root/AK/FloatingPoint.h
diff options
context:
space:
mode:
authorDan Klishch <danilklishch@gmail.com>2022-11-03 18:37:37 -0400
committerAndrew Kaster <andrewdkaster@gmail.com>2022-11-03 20:17:09 -0600
commit59e87cc9985d90bca7141eb49f9d57e534b677de (patch)
treef9587386908b5f6a49d9ef730277ce0cfa6f0496 /AK/FloatingPoint.h
parent56aa21a7dc9bfb6531fa378b09858d2225d8d52c (diff)
downloadserenity-59e87cc9985d90bca7141eb49f9d57e534b677de.zip
AK: Add static_assert to check for effective size of long double
Diffstat (limited to 'AK/FloatingPoint.h')
-rw-r--r--AK/FloatingPoint.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/AK/FloatingPoint.h b/AK/FloatingPoint.h
index 209fbadc29..30b156d17b 100644
--- a/AK/FloatingPoint.h
+++ b/AK/FloatingPoint.h
@@ -16,7 +16,10 @@ template<typename T>
union FloatExtractor;
#if ARCH(I386) || ARCH(X86_64) || ARCH(AARCH64)
-// This assumes long double is 80 bits, which is true with GCC on Intel platforms
+// FIXME: There is no straightforward way, I can think of, to check
+// in compile time that long double is really an 80-bit IEEE574 floating point number.
+static_assert(__LDBL_MAX__ == 1.189731495357231765e4932L);
+
template<>
union FloatExtractor<long double> {
static constexpr int mantissa_bits = 64;