fn limbsCmpLt(x: anytype, y: @TypeOf(x)) bool xy: @TypeOf(x)938
939
940
941
942
943
944
945
946
947
948
949
950
951 fn limbsCmpLt(x: anytype, y: @TypeOf(x)) bool {
const x_limbs = x.limbsConst();
const y_limbs = y.limbsConst();
assert(x_limbs.len == y_limbs.len);
var i = x_limbs.len;
while (i != 0) {
i -= 1;
if (x_limbs[i] != y_limbs[i]) {
return x_limbs[i] < y_limbs[i];
}
}
return false;
}
Compares two big integers in constant time, returning true if x < y.