*fixed a number comparison bug.

This commit is contained in:
Wang Renxin 2017-11-25 19:55:21 +08:00
parent 830d0ad4ff
commit 0641d64bc0

View File

@ -9995,7 +9995,7 @@ static int _compare_numbers(const _object_t* first, const _object_t* second) {
} else {
if((first->type == _DT_INT ? (real_t)first->data.integer : first->data.float_point) > (second->type == _DT_INT ? (real_t)second->data.integer : second->data.float_point))
result = 1;
else if((first->type == _DT_INT ? (real_t)first->data.integer : first->data.float_point) > (second->type == _DT_INT ? (real_t)second->data.integer : second->data.float_point))
else if((first->type == _DT_INT ? (real_t)first->data.integer : first->data.float_point) < (second->type == _DT_INT ? (real_t)second->data.integer : second->data.float_point))
result = -1;
}