7 Aug
2002
7 Aug
'02
8:18 p.m.
From: Daniel Gudbjartsson <dfg(a)decode.is>
static int char2digit(char c, int base) { - if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0'); + if ((c>='0') && (c<='9') && (c<='0')+base-1) return (c-'0');
First off, I can't parse the above. It's A && B && C + base -1. What is that?!? If you intend to clean it up, make it more readable: + if (('0' <= c) && (c <= min('0'+base-1, '9')) return c-')'; 'cause that's what you want to say: if c is a valid digit (but no more then '9') in the given base, right? -- Dimi.
8531
Age (days ago)
8531
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dimitrie O. Paun