Re:A Special Kind of Hell: intmax_t in C and C++
by SloopJon on Saturday December 05, 2020 @04:25PM
(#25318529)
I used intmax_t just yesterday in an ODBC type conversion test. I wrote a template for use in a Google Test typed test to find the highest and lowest values supported by the client and server type. Something like:
I tried std::common_type first, but it didn't quite do the trick.
[ Parent
| on HN ]
Re:A Special Kind of Hell: intmax_t in C and C++
by secondcoming on Saturday December 05, 2020 @04:29PM
(#25318570)
Out of curiosity... did you ever fall into the trap of using
numeric_limits<T>::min()
instead of numeric_limits<T>::lowest()
? Because I did.
Re:A Special Kind of Hell: intmax_t in C and C++
by saagarjha on Saturday December 05, 2020 @04:35PM
(#25318621)
The distinction is only relevant for floating point types, is it not?
Re:A Special Kind of Hell: intmax_t in C and C++
by secondcoming on Sunday December 06, 2020 @08:58AM
(#25323478)
Yes, I believe so.