I wanted the remainder of a division with big numbers, this is what I've done: $ time wcalc "2^56 - floor(2^56 / 57)*57" = 4 real 0m0.004s user 0m0.001s ...
Daniele
scrows@...
Jun 28, 2006 10:15 am
... Heh, right. Counting up to 2^56 in 57-steps might take a while. ;-) ... Sure. Patch attached. Cheers, Ingo...
... Hmm. What is currently in CVS is this: mpfr_set_ui(temp, 0, GMP_RNDN); mpfr_div(temp, first, second, GMP_RNDN); mpfr_rint(temp, temp, GMP_RNDZ); ...
... What's the first line good for? ... -20 is not an option. The question is: When performing the integer division of -340 and 60, do you round the result by...
... Hmm, not much, come to think of it. ... Hmm, well, I tend to like not being restrictive, and I also like maintaining the existing behavior. In Wcalc 1.x,...
... Actually, if I'm reading the ADA reference manual correctly, the REM operator does exactly what your algorithm does (A REM B keeps the sign of A) while the...
... Well, I'm not saying I'm in love with ADA, I'm just suggesting we preserve the existing behavior for % and do a better/different one with a new operator...
... Well, rounding output towards zero would pick floor() or ceil() depending on the sign of output. I'm checking the sign of the first operand instead. So, if...
Perhaps I found another bug in the mod operator, I don't know if the result change with the last modifies to the way the mod works, so .. For `m % n' where `m'...
Daniele
scrows@...
Jul 5, 2006 3:35 pm
... Nope, that's wrong. Looks like I need to get this fixed version out asap. ~Kyle -- It is easier to be critical than to be correct. -- Benjamin Disraeli...