3 ms·
It's literally two lines, yet it handles hexadecimal and octal too. :) Of course, if you set up some parser combinators with a nice library in C, it could be a
by retrac 5y ago
It's literally two lines, yet it handles hexadecimal and octal too. :) Of course, if you set up some parser combinators with a nice library in C, it could be a one liner in C too.
I figure it's not the language, so much as the libraries and tooling around the language. Back in the day, one couldn't stick a term in the project definition, have the compiler automatically download and assemble a library, then invoke it with one line in the program code, all within 10 seconds. You'd have to start with "is this a digit?" and build up from there, like I did back in my CS courses with Pascal, once upon a time.