Skip to content

Commit 95efa0c

Browse files
committed
Fixed the order of if conditions
1 parent d861805 commit 95efa0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/bcmath/libbcmath/src/compare.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ bcmath_compare_result _bc_do_compare(bc_num n1, bc_num n2, size_t scale, bool us
4545

4646
/* First, compare signs. */
4747
if (use_sign && n1->n_sign != n2->n_sign) {
48-
if (n1->n_len == 1 && n2->n_len == 1 &&
48+
if ((n1->n_scale > scale || n2->n_scale > scale) &&
49+
n1->n_len == 1 && n2->n_len == 1 &&
4950
n1->n_value[0] == 0 && n2->n_value[0] == 0 &&
50-
(n1->n_scale > scale || n2->n_scale > scale) &&
5151
bc_is_zero_for_scale(n1, scale) && bc_is_zero_for_scale(n2, scale)
5252
) {
5353
/* e.g. 0.00 <=> -0.00 */

0 commit comments

Comments
 (0)