Skip to content

Commit aaf1f6a

Browse files
committed
At the end of the calculation, set the value of numerator_vectors to the correct value.
1 parent 03955d6 commit aaf1f6a

File tree

1 file changed

+2
-0
lines changed
  • ext/bcmath/libbcmath/src

1 file changed

+2
-0
lines changed

ext/bcmath/libbcmath/src/div.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static inline void bc_fast_div(
6161
}
6262
/* last */
6363
quot_vectors[0] = numerator_vectors[0] / divisor_vector;
64+
numerator_vectors[0] -= divisor_vector * quot_vectors[0];
6465
}
6566

6667
/*
@@ -248,6 +249,7 @@ static inline void bc_standard_div(
248249
div_carry = numerator_vectors[numerator_top_index - i];
249250
numerator_vectors[numerator_top_index - i] = 0;
250251
}
252+
numerator_vectors[numerator_top_index - quot_arr_size + 1] = div_carry;
251253
}
252254

253255
static void bc_do_div(

0 commit comments

Comments
 (0)