diff --git a/dc/numeric.c b/dc/numeric.c index a608405..37759de 100644 --- a/dc/numeric.c +++ b/dc/numeric.c @@ -307,8 +307,6 @@ dc_getnum DC_DECLARG((input, ibase, readahead)) int digit; int decimal; int c; - int c_buff = 0; - int multi = 0; bc_init_num(&tmp); bc_init_num(&build); @@ -326,9 +324,6 @@ dc_getnum DC_DECLARG((input, ibase, readahead)) } while (isspace(c)) c = (*input)(); - c_buff = (*input)(); - if (isdigit(c_buff) || ('A' <= c_buff && c_buff <= 'F') || c_buff == '.') - multi = 1; for (;;){ if (isdigit(c)) digit = c - '0'; @@ -336,15 +331,10 @@ dc_getnum DC_DECLARG((input, ibase, readahead)) digit = 10 + c - 'A'; else break; - digit = multi ? (digit >= ibase ? ibase -1 : digit) : digit; + c = (*input)(); bc_int2num(&tmp, digit); bc_multiply(result, base, &result, 0); bc_add(result, tmp, &result, 0); - if (c_buff) { - c = c_buff; - c_buff = 0; - } else - c = (*input)(); } if (c == '.'){ bc_free_num(&build); @@ -353,18 +343,13 @@ dc_getnum DC_DECLARG((input, ibase, readahead)) build = bc_copy_num(_zero_); decimal = 0; for (;;){ - if (c_buff) { - c = c_buff; - c_buff = 0; - } else - c = (*input)(); + c = (*input)(); if (isdigit(c)) digit = c - '0'; else if ('A' <= c && c <= 'F') digit = 10 + c - 'A'; else break; - digit = digit >= ibase ? ibase -1 : digit; bc_int2num(&tmp, digit); bc_multiply(build, base, &build, 0); bc_add(build, tmp, &build, 0); diff --git a/doc/bc.1 b/doc/bc.1 index 7ff6a2d..eeda08b 100644 --- a/doc/bc.1 +++ b/doc/bc.1 @@ -175,8 +175,6 @@ The result of the expression is the sum of the two expressions. The result of the expression is the difference of the two expressions. .IP "expr * expr" The result of the expression is the product of the two expressions. -If a and b are the scales of the two expressions, then the scale of the result is: -min(a+b,max(scale,a,b)) .IP "expr / expr" The result of the expression is the quotient of the two expressions. The scale of the result is the value of the variable \fBscale\fR. diff --git a/doc/bc.texi b/doc/bc.texi index 0bc9c80..40034ab 100644 --- a/doc/bc.texi +++ b/doc/bc.texi @@ -291,8 +291,6 @@ The result of the expression is the difference of the two expressions. @item expr * expr The result of the expression is the product of the two expressions. -If a and b are the scales of the two expressions, then the scale of the result is: -min(a+b,max(@var{scale},a,b)) @item expr / expr The result of the expression is the quotient of the two expressions.