From f066c0f01efb1ad3d38d5d8d255234aaa5849fd2 Mon Sep 17 00:00:00 2001 From: s2ks Date: Sat, 28 May 2022 15:27:32 +0200 Subject: [PATCH] correct size calculation --- src/utils/HammingCodeTools.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/HammingCodeTools.ts b/src/utils/HammingCodeTools.ts index e057f3a0a..11ccc31ed 100644 --- a/src/utils/HammingCodeTools.ts +++ b/src/utils/HammingCodeTools.ts @@ -60,7 +60,7 @@ export function HammingEncodeProperly(data: number): string { let m = 1; - while (2 ** (2 ** m - m - 1) < data) { + while (((2**((2**m) - m - 1)) - 1) < data) { m++; }