From fe916c402bab77a97286a56cfe4a3992092749bb Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Fri, 23 Jan 2026 12:07:34 +0100 Subject: Write 1UL instead of 1 for function representation to make shift operation work correctly. --- charf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index b3aa4e0..53ab4ef 100644 --- a/charf.c +++ b/charf.c @@ -37,7 +37,7 @@ typedef unsigned long index_t; /*maximum length of the support of f*/ -#define N 32 +#define N 36 /*maximal order of derivative*/ #define K 64 @@ -157,9 +157,9 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){ /*Generates all characteristic functions of length up N.*/ int generate_each_charf(VALUETYPE* f, index_t i){ index_t s=0; - int d=1; + int d=31; /*number of strings of length d that begin with 1*/ - index_t powd = 1; + index_t powd = 1UL << d-1; /*number of strings of length d that begin with 1 but are not all 1*/ while(i-s >= powd-1){ s += powd-1; @@ -170,7 +170,7 @@ int generate_each_charf(VALUETYPE* f, index_t i){ if(d>N) return -1; /*t starts with 1 and then comes i-s.*/ - index_t t = (1 << d-1) + i-s; + index_t t = (1UL << d-1) + i-s; /*Indicates if we want to consider this t.*/ bool is_representative = true; @@ -180,7 +180,7 @@ int generate_each_charf(VALUETYPE* f, index_t i){ if(d % r == 0){ bool is_r_copy = true; index_t ones = 0; - for(int o = 0; o>n*r) & ones ) != tail ) is_r_copy = false; if(is_r_copy) is_representative = false; -- cgit v1.2.3