Fix the issue where number types are compared incorrectly.

This commit is contained in:
obdev
2023-03-09 11:41:13 +00:00
committed by ob-robot
parent 702ea5cd2d
commit 661f406f80

View File

@ -156,6 +156,25 @@ private:
if (n2 > 0) {
digits[1] = n2;
}
//normalize
if (d.len_ == 2) {
if (digits[0] == 0) {
d.len_ = 1;
digits[0] = digits[1];
d.exp_ -= 1;
} else if (digits[1] == 0) {
d.len_ = 1;
}
}
if (d.len_ == 1) {
if (digits[0] == 0) {
d.len_ = 0;
d.exp_ = 0;
}
}
number_fast_ctx.is_fast_number_ = true;
return ret;
}