Constant overflow

Alan_Rooks_sps alan at bk.dk
Fri Mar 11 21:47:41 AEST 1988


In article <2550059 at hpisod2.HP.COM> decot at hpisod2.HP.COM (Dave Decot) writes:

>It's hard to do this right unless you do some clever comparison
>just before multiplying by 10 (or 8 or 16 or 2).

A proven (and very simple) way to do this right was given by J. R. Parker in
"A General Character to Integer Conversion Method", Software - Practice and
Experience, Vol 15(8) (August '85), pp. 761-766.

Alan Rooks - Bruel & Kjaer Copenhagen - ...!mcvax!bk!alan or ...!diku!bk!alan



More information about the Comp.lang.c mailing list