mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
AK: Add static_assert to check for effective size of long double
This commit is contained in:
parent
56aa21a7dc
commit
59e87cc998
Notes:
sideshowbarker
2024-07-17 04:48:16 +09:00
Author: https://github.com/DanShaders
Commit: 59e87cc998
Pull-request: https://github.com/SerenityOS/serenity/pull/15796
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/davidot ✅
Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 1 deletions
|
@ -16,7 +16,10 @@ template<typename T>
|
||||||
union FloatExtractor;
|
union FloatExtractor;
|
||||||
|
|
||||||
#if ARCH(I386) || ARCH(X86_64) || ARCH(AARCH64)
|
#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<>
|
template<>
|
||||||
union FloatExtractor<long double> {
|
union FloatExtractor<long double> {
|
||||||
static constexpr int mantissa_bits = 64;
|
static constexpr int mantissa_bits = 64;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue