From bd310edb969c3179a0a74c09cbc16be61a6d92e2 Mon Sep 17 00:00:00 2001 From: Elk Cloner <28754537+elkcl@users.noreply.github.com> Date: Fri, 23 Apr 2021 23:24:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=B2?= =?UTF-8?q?=20=D0=BA=D0=B0=D1=80=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В разряде должен оставаться как раз остаток от деления на основание, а вот уже всё остальное переносится на следующий. --- karatsuba.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/karatsuba.md b/karatsuba.md index a4af8d7..6399b7f 100644 --- a/karatsuba.md +++ b/karatsuba.md @@ -32,8 +32,8 @@ void carry(int *a, int n) { int d = 0; for (int i = 0; i < n; i++) { a[i] += d; - d = a[i] % base; - a[i] /= base; + d = a[i] / base; + a[i] %= base; } } ```