Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: towards a faster isdigit() Message-ID: <16104@smoke.brl.mil> Date: 10 May 91 22:33:16 GMT References: <1991May8.030515.7004@twinsun.com> <1991May8.154453.4462@intellistor.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 14 In article <1991May8.154453.4462@intellistor.com> wicklund@intellistor.com (Tom Wicklund) writes: >1) Numeric digits aren't adjacent character codes in all character >sets (though I can't think of an example where this isn't true off >hand). Oh, yes they are, at least in terms of the C source character set, because that is a requirement the standard imposes on a conforming implementation. (I argues and voted against that, by the way.) >2) The (unsigned) cast may not work (I think an implementation could >return abs(x) as the result of an (unsigned) cast but am not sure), Type conversions are carefully specified in the C standard; what you describe is not allowed in a conforming implementation.