"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "arith.c" between
txr-224.tar.bz2 and txr-225.tar.bz2

About: TXR is a programming language for convenient data munging. As a query tool it extracts pieces of text buried in one or more text files based on pattern matching.

arith.c  (txr-224.tar.bz2):arith.c  (txr-225.tar.bz2)
skipping to change at line 3725 skipping to change at line 3725
return normalize(bignum_from_uintptr(coerce(uint_ptr_t, obj))); return normalize(bignum_from_uintptr(coerce(uint_ptr_t, obj)));
} }
static val digcommon(int pow, val self, val n, val base_in) static val digcommon(int pow, val self, val n, val base_in)
{ {
val r = default_arg_strict(base_in, num_fast(10)); val r = default_arg_strict(base_in, num_fast(10));
if (!integerp(n) || minusp(n)) if (!integerp(n) || minusp(n))
uw_throwf(error_s, lit("~a: value ~s must be positive integer"), uw_throwf(error_s, lit("~a: value ~s must be positive integer"),
self, n, nao); self, n, nao);
if (!integerp(r) || lt(r, one)) if (!integerp(r) || le(r, one))
uw_throwf(error_s, lit("~a: base ~s must be positive integer"), uw_throwf(error_s, lit("~a: base ~s must be positive integer"),
self, r, nao); self, r, nao);
{ {
val k = r; val k = r;
val p = nil, p0; val p = nil;
list_collect_decl (out, ptail); list_collect_decl (out, ptail);
while (lt(k, n)) { while (le(k, n)) {
push(k, &p); push(k, &p);
k = mul(k, r); k = mul(k, r);
} }
while ((p0 = pop(&p))) { while (p) {
val p0 = rcyc_pop(&p);
cnum i = 0; cnum i = 0;
while (ge(n, p0)) { while (ge(n, p0)) {
i++; i++;
n = minus(n, p0); n = minus(n, p0);
} }
ptail = list_collect(ptail, if3(pow, ptail = list_collect(ptail, if3(pow,
mul(num_fast(i), p0), mul(num_fast(i), p0),
num_fast(i))); num_fast(i)));
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)