From f3decbe84797f95f279871afaeb2938799818478 Mon Sep 17 00:00:00 2001 From: Lance Gliser Date: Wed, 25 Sep 2024 16:32:06 -0500 Subject: [PATCH] Prevented condition in precision that lead to infinate loops --- src/features/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/features/utils.ts b/src/features/utils.ts index 29bf08a..2cc351f 100644 --- a/src/features/utils.ts +++ b/src/features/utils.ts @@ -9,6 +9,10 @@ export function precision(x: number): number { let p = 0; while (Math.round(x * e) / e !== x) { e *= 10; + // Happened on several columns in the asteroid data set. moid for sure. + if (!isFinite(e)) { + return p; + } p++; } return p;