-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for GMP code and start overhauling it #1045
Commits on Jan 11, 2017
-
Configuration menu - View commit details
-
Copy full SHA for cf12444 - Browse repository at this point
Copy the full SHA cf12444View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a3f678 - Browse repository at this point
Copy the full SHA 4a3f678View commit details -
tests: make intarith.tst more systematic
* test negative integers (small and big), too * systematically test all possible juxtapositions of arguments for the operations that are covered * sorted tests by which kernel function they exercise, and document the name of the function in a comment * add tests for more functions (ModInt, ProdInt, AbsInt, ...) * move PValuation tests to new file numtheor.tst (PValuation is not basic integer arithmetic, so it does not belong into intarith.tst)
Configuration menu - View commit details
-
Copy full SHA for 1b8681c - Browse repository at this point
Copy the full SHA 1b8681cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 90c22ef - Browse repository at this point
Copy the full SHA 90c22efView commit details -
gmpints: improve optimization for "x mod 2^k" for small k
We already did this, but for fewer values of k than possible, and also using an inefficient integer division instead of a shift
Configuration menu - View commit details
-
Copy full SHA for a352b8a - Browse repository at this point
Copy the full SHA a352b8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for aa9c3b7 - Browse repository at this point
Copy the full SHA aa9c3b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bc3eca - Browse repository at this point
Copy the full SHA 3bc3ecaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f504df - Browse repository at this point
Copy the full SHA 8f504dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7cdf8c9 - Browse repository at this point
Copy the full SHA 7cdf8c9View commit details -
gmpints: rewrote PowInt, and fix 0^-LARGEINT
This commit simplifies the code of PowInt, reducing code duplication. This fixes a bug where 0^-LARGEINT returned 0, instead of raising an error; and ensures that optimizations for certain special cases always take effect, even if the exponent is large.
Configuration menu - View commit details
-
Copy full SHA for 4e0bc63 - Browse repository at this point
Copy the full SHA 4e0bc63View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbf44e2 - Browse repository at this point
Copy the full SHA dbf44e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bddc188 - Browse repository at this point
Copy the full SHA bddc188View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0654aa - Browse repository at this point
Copy the full SHA b0654aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for c72c8da - Browse repository at this point
Copy the full SHA c72c8daView commit details -
Configuration menu - View commit details
-
Copy full SHA for b558aba - Browse repository at this point
Copy the full SHA b558abaView commit details -
* NEW_INTNEG was commented out and also trivial to reimplement * ProdIntObjFunc and PowObjIntFunc were declared but never used * SMALLEST_INTPOS was exported to the language level, but unused
Configuration menu - View commit details
-
Copy full SHA for 66a5d51 - Browse repository at this point
Copy the full SHA 66a5d51View commit details -
gmpints: pedantic tweak to ModInt
This change should be mostly irrelevant.; indeed, the C99 standard mandates that a%b and a%(-b) are equal, and even on most pre-C99 compiler this holds true -- but not all. We could instead also add a configure test, and reject compilers violating this; in that case, we can obviously just stop checking the sign of k.
Configuration menu - View commit details
-
Copy full SHA for 1195105 - Browse repository at this point
Copy the full SHA 1195105View commit details -
compiler: be defensive about possible INTEGER_UNIT_SIZE values
In particular, if INTEGER_UNIT_SIZE ever differs from 2, 4, 8, produce an error. Also replace some tabs by spaces.
Configuration menu - View commit details
-
Copy full SHA for 8933614 - Browse repository at this point
Copy the full SHA 8933614View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bddb1c - Browse repository at this point
Copy the full SHA 5bddb1cView commit details -
The result should also be a bit faster when comparing a small with a large integer, as we immediately return false, instead of first converting the small integer into a large one, then calling mpn_cmp. This relies on all integers always being normalized and reduced.
Configuration menu - View commit details
-
Copy full SHA for 8539203 - Browse repository at this point
Copy the full SHA 8539203View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2f82d5 - Browse repository at this point
Copy the full SHA f2f82d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fe0b1a - Browse repository at this point
Copy the full SHA 7fe0b1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a00950 - Browse repository at this point
Copy the full SHA 1a00950View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b891cb - Browse repository at this point
Copy the full SHA 1b891cbView commit details -
lib: change AbsInt/SignInt methods to use ABS_RAT and SIGN_RAT
We cannot simply use ABS_INT and SIGN_INT, as one might expect given the names AbsInt/SignInt, as a lot of library code (and likely in packages and elsewhere) is relying on the undocumented fact that the old AbsInt and SignInt implementations also worked for rationals.
Configuration menu - View commit details
-
Copy full SHA for 3f994af - Browse repository at this point
Copy the full SHA 3f994afView commit details -
Configuration menu - View commit details
-
Copy full SHA for f623903 - Browse repository at this point
Copy the full SHA f623903View commit details -
lib: use AbsoluteValue instead of AbsInt
AbsoluteValue used to invoke AbsInt on non-integer rationals. While this works, this is undocumented
Configuration menu - View commit details
-
Copy full SHA for f92fb1f - Browse repository at this point
Copy the full SHA f92fb1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 862b3e1 - Browse repository at this point
Copy the full SHA 862b3e1View commit details -
lib: remove shortbanner support
This was added 2010-11-02 as an experimental feature by Laurent. But it was never documented, nor hooked up to anything, or usable without modifying the library.
Configuration menu - View commit details
-
Copy full SHA for d761332 - Browse repository at this point
Copy the full SHA d761332View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9794cf4 - Browse repository at this point
Copy the full SHA 9794cf4View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd2fd18 - Browse repository at this point
Copy the full SHA bd2fd18View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a7c173 - Browse repository at this point
Copy the full SHA 7a7c173View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf8a3e9 - Browse repository at this point
Copy the full SHA cf8a3e9View commit details -
gmpints: remove invalid ModInt return value treatment
Before returning the computed result, ModInt checked whether it was negative, it flipped the sign. This should (a) never be necessary, because the preceding computations should always produce something non-negative, and (b) would be mathematically incorrect. Instead, we simply return the result untreated, and added an assertion triggering if we ever see a negative result here (only enabled if DEBUG_GMP is set).
Configuration menu - View commit details
-
Copy full SHA for 9730707 - Browse repository at this point
Copy the full SHA 9730707View commit details
Commits on Jan 12, 2017
-
gmpints: add CHECK_INT macro for debugging
To turn this on, #define DEBUG_GMP 1
Configuration menu - View commit details
-
Copy full SHA for 7e51920 - Browse repository at this point
Copy the full SHA 7e51920View commit details -
gmpints: reduce output of IntHexString
This fix a bug, as IntHexString could return a non-reduced integer.
Configuration menu - View commit details
-
Copy full SHA for 01f3bef - Browse repository at this point
Copy the full SHA 01f3befView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bc3d6c - Browse repository at this point
Copy the full SHA 1bc3d6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74280ef - Browse repository at this point
Copy the full SHA 74280efView commit details