Open dzarda opened 3 years ago
Unfortunately, the UDL, ""_c
does not work with fractions. C++17 is only allowed to use integral NTTPs (non-type template parameters) and as 0.22 isn't even representable in binary floating-point, it's out of the running.
Sorry that it compiles at all! (It doesn't under v2 branch. Action: deprecate ""_c
.)
Describe the bug:
I'm seeing a weird representation of a
_c
literal decimal value such as0.22_c
. It seems turn into a massive value in the rep.To Reproduce:
Expected behavior:
Both reps should be 56.
Screenshots: Double literal:
Custom literal:
Desktop (please complete the following information):
-DNDEBUG -std=c++17 -Iinclude
Link to Compiler Explorer:
https://godbolt.org/z/vTjdz5sah