Newsgroups: comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!news.cs.indiana.edu!msi.umn.edu!widener!sven From: sven@cs.widener.edu (Sven Heinicke) Subject: Re: towards a faster isdigit() Message-ID: Date: Thu, 09 May 91 15:27:07 GMT Organization: Widener CS Dept Nntp-Posting-Host: ashley.cs.widener.edu References: <1991May8.030515.7004@twinsun.com> <716@taumet.com> <1991May9.025552.2292@research.canon.oz.au> Lines: 20 In <1991May9.025552.2292@research.canon.oz.au>, andy@research.canon.oz.au writes: >eggert@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@cs.widener.edu Widener CS system manager Sven Mike Heinicke and Student (pssmheinicke@cyber.widener.edu (if you must))