diff --git a/dc.1 b/dc.1 index e28fbc9..21e45de 100644 --- a/dc.1 +++ b/dc.1 @@ -22,9 +22,7 @@ Numbers are arbitrary-precision decimal values. Numbers may contain a decimal point and use .Ql _ as a negative sign prefix. -When the input base is greater than 10, letters A-F or a-f represent digits 10-15. -A hexadecimal number beginning with a lower case letter -must be preceded by a zero to distinguish it from the command associated with the letter. +When the input base is greater than 10, letters A-F represent digits 10-15. .Sh OPTIONS .Bl -tag -width Ds .It Fl i @@ -252,9 +250,8 @@ The .Fl i flag, .Ic # -comments, +comments and the .Ic ~ -operator, and lowercase hexadecimal digits -.Pq a-f +operator are extensions to the traditional dc specification. diff --git a/dc.c b/dc.c index 3ba20d9..13f988b 100644 --- a/dc.c +++ b/dc.c @@ -1100,7 +1100,7 @@ tonum(void) dot = NULL; for (t = s; (ch = *t) > 0 || ch <= UCHAR_MAX; ++t) { - if (!strchr(digits, toupper(ch))) + if (!strchr(digits, ch)) break; if (ch == '.') { if (dot) @@ -1115,7 +1115,7 @@ tonum(void) * For each digit: num = num * ibase + digit */ for (t = s; t < (dot ? dot : end); ++t) { - d = strchr(digits, toupper(*t)) - digits; + d = strchr(digits, *t) - digits; muln(num, ibase); addn(num, d); } @@ -1136,7 +1136,7 @@ tonum(void) denom = copy(&one); numer = copy(&zero); for (t = dot + 1; t < end; ++t) { - d = strchr(digits, toupper(*t)) - digits; + d = strchr(digits, *t) - digits; muln(denom, ibase); muln(numer, ibase); addn(numer, d);