towards a faster isdigit()

Sven Heinicke sven at cs.widener.edu
Fri May 10 01:27:07 AEST 1991


In <1991May9.025552.2292 at research.canon.oz.au>, andy at research.canon.oz.au writes:
>eggert at twinsun.com (Paul Eggert) writes:
>> Why not use the following implementation instead?
>>
>>	#define isdigit(c) ((unsigned)((c)-'0') < 10)
>
>Only works for character sets that have the decimal digits
>arranged contiguously and with digit '0' having a lower
>numeric value than any other digit character. This works
>for ASCII and EBCDIC but what about other character sets?

I am not saying that is is a bad argument because we don't know what
is to come in the future but are there anyother kinds of systems that
are used besides ASCII and EBCDIC that show promise in the future (I
hope there are, because ASCII could use some work)

-- 
sven at cs.widener.edu                                  Widener CS system manager
Sven Mike Heinicke                                          and Student
(pssmheinicke at cyber.widener.edu (if you must))



More information about the Comp.lang.c mailing list