summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--charf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/charf.c b/charf.c
index 6a35d3f..2552b06 100644
--- a/charf.c
+++ b/charf.c
@@ -166,13 +166,15 @@ void compute(EXPTYPE p, int D, VALUETYPE* f, VALUETYPE* records){
VALUETYPE r = ratio(intdMfp, intdfp);
double t = to_double(r);
- if(over_threshold_charf(t,k) && is_greater(r,records[k])){
+ if(
+ over_threshold_charf(t,k) &&
+ is_greater(r,records[k])){
/*extra check for printing only because in error mode for some reason floats randomly seem to increase by tiny amounts*/
if(t>to_double(records[k])){
- char s[256];
+ char s[1024];
sprintf(s,"f: ");
int l = 3;
- for(int i=0; i<D; i++) l += sprintf(s+l,"%1.0f ",to_double(f[i]));
+ for(int i=0; i<D; i++) l += sprintf(s+l,"%2.0f ",to_double(f[i]));
for(int i=D; i<N; i++) l += sprintf(s+l," ");
char rts[128];
root_to_string(rts,r,p);
@@ -187,7 +189,7 @@ void compute(EXPTYPE p, int D, VALUETYPE* f, VALUETYPE* records){
/*Generates all characteristic functions of length up N.*/
int generate_each_charf(VALUETYPE* f, int i){
int s=0;
- int d=1;
+ int d=2;
while(d <= N){
/*number of strings of length d that are not all 0s or all 1s*/
int powd = (1<<d)-2;