How do I get maxBound
of Int
in Idris? I want to write my code such that it works both when the word size is 32-bit and 64-bit, and I think that will change the size of the Int.
Maximum Int in Idris
46 views Asked by Janus Troelsen At
1
I don't believe there is such a function in Idris. I think I asked this question on the language forum a while back, and the answer was no, but I might be misremembering.
That said, you seem to be assuming that
Int
andint
have the same width for every platform. I don't know if that's true, but if it were, you could write an FFI function to getINT_MAX
from#include <limits.h>
.Really though, I'd ask if you need to use a C
int
(and IdrisInt
) at all, and whether you can useint32_t
andInt32
, orint64_t
andInt64
.