mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-bigint: increase KARATSUBA_THREASHOLD to 512
Since Karatsuba algorithm is far heavier than the basic multiplication, we have increased KARATSUBA_THREASHOLD and decreased MAX_RECURSION_DEPTH.
This commit is contained in:
@@ -385,8 +385,8 @@ mul_base(mrb_state *mrb, mpz_t *ww, mpz_t *u, mpz_t *v)
|
||||
static void mpz_mul_2exp(mrb_state *mrb, mpz_t *z, mpz_t *x, mrb_int e);
|
||||
|
||||
/* Thresholds */
|
||||
#define KARATSUBA_THRESHOLD 32
|
||||
#define MAX_RECURSION_DEPTH 16
|
||||
#define KARATSUBA_THRESHOLD 512
|
||||
#define MAX_RECURSION_DEPTH 10
|
||||
|
||||
/* Karatsuba Multiply */
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user