On Tue, 1 Aug 2023 at 13:55, David Rowley <dgrowle...@gmail.com> wrote: > > I tried adding the "at least 1 digit check" by adding an else { goto > slow; } in the above code, but it seems to generate slower code than > just checking if (unlikely(ptr == s)) { goto slow; } after the loop. >
That check isn't quite right, because "ptr" will not equal "s" if there is a sign character, so it won't detect an input with no digits in that case. Regards, Dean