diff options
author | Sven Göthel <[email protected]> | 2024-08-08 17:21:00 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-08-08 17:21:00 +0200 |
commit | 59da5b1a9f14875eb0cbc24448463baac79b041f (patch) | |
tree | dc178837a262d02c69afdb0c5ec1134d008f44da /include | |
parent | 63d3f1e823423f11e7009b45f33a2c03a39f6b3d (diff) |
float_types.hpp: Fix static_assertion and float_literals
Diffstat (limited to 'include')
-rw-r--r-- | include/jau/float_types.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/jau/float_types.hpp b/include/jau/float_types.hpp index 9c3af27..2dc08e3 100644 --- a/include/jau/float_types.hpp +++ b/include/jau/float_types.hpp @@ -41,15 +41,15 @@ namespace jau { typedef std::float32_t float32_t; typedef std::float64_t float64_t; #else - static_assert(32 == sizeof(float)); - static_assert(64 == sizeof(double)); + static_assert(32 == sizeof(float)<<3); + static_assert(64 == sizeof(double)<<3); typedef float float32_t; typedef double float64_t; #endif namespace float_literals { - constexpr float32_t operator ""_f32(float32_t __v) { return (float32_t)__v; } - constexpr float64_t operator ""_f64(float64_t __v) { return (float64_t)__v; } + constexpr float32_t operator ""_f32(long double __v) { return (float32_t)__v; } + constexpr float64_t operator ""_f64(long double __v) { return (float64_t)__v; } } // float_literals /**@}*/ |