compareIntegers

Convert to given type without errors by bounding values to target type limits.

pure nothrow @safe @nogc
int
compareIntegers
(
Int
)
(
Int lhs
,
Int rhs
)
if (
isIntegral!Int
)

Examples

assert(compareIntegers( 1, 1) == 0);
assert(compareIntegers(-1, 1) < 0);
assert(compareIntegers( 1, -1) > 0);
assert(compareIntegers(int.min, int.min) == 0);

Meta