On Sun 30 Jan 2011 17:27, Mark H Weaver <[email protected]> writes: > Here are another four patches of numerics improvements.
Applied all up to the last. Sweet! And thank you! > The other three I named `centered/', `centered-quotient', and > `centered-remainder', because the range of their remainder operation is > centered on 0 in a twos-complement sort of way. They are almost the > same as Taylor's `round/' et al, but in my opinion they have superior > properties, as I explained in a recent commentary on this list. I agree they do have some good properties, and am happy to see them in the core, and with non-privileged names (allowing for round_quotient et al to be added, possibly, in the future). If you have time though, I wonder would scm_centered_divide be a better name than scm_centered_quo_and_rem? "Divide" is the pronunciation of the "/" procedure, I think. > The last two patches improve the extensibility of numeric operations, > and as a side effect add documentation strings to many of them. Much appreciated. > The last patch might be slightly controversial. Although it does not > make `integer-expt' a generic function, nonetheless it can now > exponentiate _any_ scheme object that can be multiplied using `*'. To me this is fine, in principle; but I wonder about causing `(expt #t 0)' to produce 1. It seems that in any case the range of the output should be continuous -- i.e. if (expt <my-matrix> 1) produces a matrix, and (expt <my-matrix> n) for n > 1 makes a matrix, then (expt <my-matrix> 0) should also produce a matrix. Or no? Cheers, Andy -- http://wingolog.org/
