
23 Feb
2013
23 Feb
'13
6:25 p.m.
<snip>
BTW, I can see a genuine use case for constexpr 128-bit float constants even if the right way to handle __float128 is to wrap it in the Multiprecision lib. I wonder are there any predefined macros we can use like __SIZEOF_INT128__ is for __int128? John.
I agree, of course. It guarantees compile-time const-ness.
<snip> Of course, I made a mistake. You need to qualify the return value with constexpr. template<typename built_in_float_type> constexpr built_in_float_type const_pi() { // This is a true compile-time constant. return built_in_float_type(3.14159265358979323846264338327950288419716939937511); } Sorry. Sincerely, Chris.