Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
add debug norm statements to big
Browse files Browse the repository at this point in the history
  • Loading branch information
samuele-andreoli committed Apr 12, 2020
1 parent d036f3e commit 8e805c2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/big.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ int BIG_XXX_iszilch(BIG_XXX a)
int i;
chunk d = 0;

#ifdef DEBUG_NORM
if ((a[MPV_XXX]!=1 && a[MPV_XXX]!=0) || a[MNV_XXX]!=0) printf("Input to iszilch not normed\n");
#endif

for (i=0; i<NLEN_XXX; i++)
d |= a[i];

Expand All @@ -45,6 +49,10 @@ int BIG_XXX_isunity(BIG_XXX a)
int i;
chunk d = 0;

#ifdef DEBUG_NORM
if ((a[MPV_XXX]!=1 && a[MPV_XXX]!=0) || a[MNV_XXX]!=0) printf("Input to isunity not normed\n");
#endif

for(i=1; i<NLEN_XXX; i++)
d |= a[i];

Expand All @@ -58,6 +66,10 @@ int BIG_XXX_diszilch(DBIG_XXX a)
int i;
chunk d = 0;

#ifdef DEBUG_NORM
if ((a[DMPV_XXX]!=1 && a[DMPV_XXX]!=0) || a[DMNV_XXX]!=0) printf("Input to diszilch not normed\n");
#endif

for (i=0; i<DNLEN_XXX; i++)
d |= a[i];

Expand Down Expand Up @@ -1027,6 +1039,11 @@ int BIG_XXX_comp(BIG_XXX b1,BIG_XXX b2)
chunk gt = 0;
chunk eq = 1;

#ifdef DEBUG_NORM
if ((b1[MPV_XXX]!=1 && b1[MPV_XXX]!=0) || b1[MNV_XXX]!=0) printf("First input to comp not normed\n");
if ((b2[MPV_XXX]!=1 && b2[MPV_XXX]!=0) || b2[MNV_XXX]!=0) printf("Second input to comp not normed\n");
#endif

for (i = NLEN_XXX-1; i>=0; i--)
{
gt |= ((b2[i]-b1[i]) >> BASEBITS_XXX) & eq;
Expand All @@ -1045,6 +1062,11 @@ int BIG_XXX_dcomp(DBIG_XXX b1,DBIG_XXX b2)
chunk gt = 0;
chunk eq = 1;

#ifdef DEBUG_NORM
if ((b1[DMPV_XXX]!=1 && b1[DMPV_XXX]!=0) || b1[DMNV_XXX]!=0) printf("First input to dcomp not normed\n");
if ((b2[DMPV_XXX]!=1 && b2[DMPV_XXX]!=0) || b2[DMNV_XXX]!=0) printf("Second input to dcomp not normed\n");
#endif

for (i=DNLEN_XXX-1; i>=0; i--)
{
gt |= ((b2[i]-b1[i]) >> BASEBITS_XXX) & eq;
Expand Down

0 comments on commit 8e805c2

Please sign in to comment.