Currently, binary comparisons between unsigned longs and other numeric types are unsupported. Supporting comparisons however does not require resolving any of the tricky casting questions that arithmetic needs to figure out. We know that all negative numbers are strictly less than all unsigned longs, so we can just return appropriately. For non-negative values, ints and longs can safely be cast to unsigned longs, and unsigned longs can be cast to double (which is lossy, but is what longs do)
Currently, binary comparisons between unsigned longs and other numeric types are unsupported. Supporting comparisons however does not require resolving any of the tricky casting questions that arithmetic needs to figure out. We know that all negative numbers are strictly less than all unsigned longs, so we can just return appropriately. For non-negative values,
ints
andlongs
can safely be cast tounsigned longs
, andunsigned longs
can be cast todouble
(which is lossy, but is whatlongs
do)