How does one specify the maximum value representable for an unsigned
integer type?
I would like to know how to initialize min
in the loop below
A lightweight package contains them (as well as other int types limits and some widely used integer functions):
import (
"fmt"
"/go-imath/ix"
"/go-imath/ux"
)
...
fmt.Println(ix.Minimal) // Output: -2147483648 (32-bit) or -9223372036854775808 (64-bit)
fmt.Println(ix.Maximal) // Output: 2147483647 or 9223372036854775807
fmt.Println(ux.Minimal) // Output: 0
fmt.Println(ux.Maximal) // Output: 4294967295 or 18446744073709551615