schoppenhauer wrote:As far as I know, most processors are calculating sums and products directly modulo 2^n for some n, i.e. x86 modulo 2^32. This would be sufficient for my purposes (and it would certainly be faster).
Specifying (integer -10000 10000) or fixnum seems not to be enough. I read http://www.sbcl.org/manual/Modular-arithmetic.html - this doesnt seem to work for multiplying, and it only holds for sbcl - but on the other hand, it is about a very old version of sbcl, maybe it meanwhile has gotten better.
dmitry_vk wrote:As far as I know, declaring types of functions arguments, local variables (with declare) and intermediate results (with the) and setting high level of optimization for speed and low level of optimization for safety should use CPU's native arithmetics (by the way, on x86 it is not modulo 2^32, but modulo 2^28).
Users browsing this forum: Yahoo [Bot] and 2 guests