summaryrefslogtreecommitdiff
path: root/tests/t-constants.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2000-08-25 02:59:11 +0200
committerKevin Ryde <user42@zip.com.au>2000-08-25 02:59:11 +0200
commita083b0bc3586937d986c968a124550ca2e0dc9de (patch)
tree4e1e85e18d406be2df770427efc8c2ae535ef05f /tests/t-constants.c
parent1fdb5e42204ea67ada237d9864192593cd469318 (diff)
downloadgmp-a083b0bc3586937d986c968a124550ca2e0dc9de.tar.gz
* gmp-impl.h (MODLIMB_INVERSE_3): New constant.
* mpn/generic/diveby3.c: Use it instead of own INVERSE_3. * mpn/generic/mul_n.c: Ditto. * tests/t-constants.c: Check it, and PP_INVERTED too.
Diffstat (limited to 'tests/t-constants.c')
-rw-r--r--tests/t-constants.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/t-constants.c b/tests/t-constants.c
index 1c88a3c2b..8bb910dbe 100644
--- a/tests/t-constants.c
+++ b/tests/t-constants.c
@@ -24,6 +24,7 @@ MA 02111-1307, USA.
#include <stdio.h>
#include "gmp.h"
#include "gmp-impl.h"
+#include "longlong.h"
#if HAVE_STRINGIZE
@@ -69,5 +70,18 @@ main (void)
CHECK_CONDITION (2*sizeof(UHWtype) >= sizeof(UWtype));
+ {
+ mp_limb_t modlimb_inverse_3_calc;
+ modlimb_invert (modlimb_inverse_3_calc, CNST_LIMB(3));
+ CHECK_CONSTANT (MODLIMB_INVERSE_3, modlimb_inverse_3_calc);
+ CHECK_CONDITION (MODLIMB_INVERSE_3 * CNST_LIMB(3) == CNST_LIMB(1));
+ }
+
+ {
+ mp_limb_t pp_inverted_calc;
+ invert_limb (pp_inverted_calc, PP);
+ CHECK_CONSTANT (PP_INVERTED, pp_inverted_calc);
+ }
+
exit (0);
}