File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -300,12 +300,16 @@ static void bc_do_div(
300
300
}
301
301
}
302
302
303
+ static inline void bc_divide_copy_numerator (bc_num numerator , bc_num * num , size_t scale )
304
+ {
305
+ scale = MIN (numerator -> n_scale , scale );
306
+ * num = bc_new_num_nonzeroed (numerator -> n_len , scale );
307
+ memcpy ((* num )-> n_value , numerator -> n_value , numerator -> n_len + scale );
308
+ }
309
+
303
310
static inline void bc_divide_by_one (bc_num numerator , bc_num * quot , size_t quot_scale )
304
311
{
305
- quot_scale = MIN (numerator -> n_scale , quot_scale );
306
- * quot = bc_new_num_nonzeroed (numerator -> n_len , quot_scale );
307
- char * qptr = (* quot )-> n_value ;
308
- memcpy (qptr , numerator -> n_value , numerator -> n_len + quot_scale );
312
+ bc_divide_copy_numerator (numerator , quot , quot_scale );
309
313
}
310
314
311
315
static inline void bc_divide_by_pow_10 (
You can’t perform that action at this time.
0 commit comments