On Wed, Feb 15, 2006 at 10:05:24AM -0600, Dan Nelson wrote:
> Your function is simpler than the C implementation on that site, but
> falls over when a run of numbers exceeds 2^31 (raise it to 2^64 if you
> use strtoull, but that's as high as you can yet).

That problem can be avoided fairly easily. First skip the leading zeroes
on both sides, then strspn for digits; the longest run of digits is
greater, otherwise strncmp it.

-- 
Jilles Tjoelker
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to