|
|
Message-ID: <aebft2RX11L33ane@beavis>
Date: Mon, 20 Apr 2026 19:23:51 -0700
From: Simon Schwartz <simon_schwartz@...oud.com>
To: musl@...ts.openwall.com
Subject: [PATCH] floatscan: replace loop with a single multiplication
Please CC me on replies.
-- >8 --
We already have a list of powers of 10 up to 10^8, so use it instead
of repeatedly multiplying by 10 up to 8 times.
---
src/internal/floatscan.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/internal/floatscan.c b/src/internal/floatscan.c
index 8c0828fc..3317056d 100644
--- a/src/internal/floatscan.c
+++ b/src/internal/floatscan.c
@@ -153,8 +153,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign, int po
/* Align incomplete final B1B digit */
if (j) {
- for (; j<9; j++) x[k]*=10;
- k++;
+ x[k++] *= p10s[8-j];
j=0;
}
--
2.52.0
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.