summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-01-16 16:24:27 +0100
committerJulian Weigt <juw@posteo.de>2026-02-04 15:55:53 +0100
commitfe85dc4e65d2aea155fbe201ff6378fcc9af0718 (patch)
tree9ddbcd961dd7d86215b293b2edba132d58f5e454
parent45fd7ef76536fdf78810e63f978bd3fc0be43537 (diff)
s/to_double/valuetype_to_double/g
-rw-r--r--charf.c10
-rw-r--r--double-error.c2
-rw-r--r--double-error.h2
-rw-r--r--double.c2
-rw-r--r--double.h2
-rw-r--r--ratio.c6
-rw-r--r--ratio.h2
7 files changed, 13 insertions, 13 deletions
diff --git a/charf.c b/charf.c
index bb8720f..e9b3ba7 100644
--- a/charf.c
+++ b/charf.c
@@ -57,7 +57,7 @@ void differentiate(VALUETYPE* f, VALUETYPE* df, int D, int k){
/*
printf("df ");
- for(int i=0;i<D;i++) printf("%+6.1f ",to_double(df[i]));
+ for(int i=0;i<D;i++) printf("%+6.1f ",valuetype_to_double(df[i]));
printf("\n");
*/
}
@@ -110,10 +110,10 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){
/*Print computed functions and averages*/
/*
printf("Mf ");
- for(int i=0;i<D;i++) printf("%+0.1f ",to_double(Mf[i]));
+ for(int i=0;i<D;i++) printf("%+0.1f ",valuetype_to_double(Mf[i]));
printf("\n");
for(int i=0;i<D;i++){
- for(int j=0;j<D;j++) printf("%0.1f ",to_double(Af[i][j]));
+ for(int j=0;j<D;j++) printf("%0.1f ",valuetype_to_double(Af[i][j]));
printf("\n");
}
*/
@@ -167,7 +167,7 @@ void format_result(char* s, int index, int k, EXPTYPE p, VALUETYPE r){
int d = generate_function(f,index);
sprintf(s,"f: ");
int l = 3;
- for(int i=0; i<d; i++) l += sprintf(s+l,"%2.0f ",to_double(f[i]));
+ for(int i=0; i<d; i++) l += sprintf(s+l,"%2.0f ",valuetype_to_double(f[i]));
for(int i=d; i<N; i++) l += sprintf(s+l," ");
char rts[128];
root_to_string(rts,r,p);
@@ -231,7 +231,7 @@ int compute(int index, int num_exponents[K+1], EXPTYPE exponents[K+1][P], VALUET
VALUETYPE r = ratio(intdMfp, intdfp);
if(
- //over_threshold_charf(to_double(r),k) &&
+ //over_threshold_charf(valuetype_to_double(r),k) &&
is_greater_possibly(r,(*records_ratio)[k][p])){
/*extra check for printing only because in error mode for some reason floats randomly seem to increase by tiny amounts*/
if(is_greater_certainly(r,(*records_ratio)[k][p])){
diff --git a/double-error.c b/double-error.c
index 4655f7c..15fd4df 100644
--- a/double-error.c
+++ b/double-error.c
@@ -112,7 +112,7 @@ double_error power(double_error de, double_error p) {
return dep;
}
-double to_double(double_error de){ return de.v; }
+double valuetype_to_double(double_error de){ return de.v; }
int root_to_string(char* s, double_error de, double_error p){
double_error de1p = power(de,ratio(int_to_valuetype(1),p));
diff --git a/double-error.h b/double-error.h
index 719b8c6..2229685 100644
--- a/double-error.h
+++ b/double-error.h
@@ -27,7 +27,7 @@ double_error absolute(double_error);
double_error power(double_error,double_error);
-double to_double(double_error);
+double valuetype_to_double(double_error);
int to_string(char*,double_error);
diff --git a/double.c b/double.c
index 9081ebb..92d087d 100644
--- a/double.c
+++ b/double.c
@@ -29,7 +29,7 @@ double absolute(double d){ return fabs(d); }
double power(double d, double p) { return pow(d,p); }
-double to_double(double d){ return d; }
+double valuetype_to_double(double d){ return d; }
int to_string(char* s, double d){
sprintf(s,"%f",d);
diff --git a/double.h b/double.h
index 077b4b8..7b23791 100644
--- a/double.h
+++ b/double.h
@@ -25,7 +25,7 @@ double absolute(double);
double power(double,double);
-double to_double(double);
+double valuetype_to_double(double);
int to_string(char*,double);
diff --git a/ratio.c b/ratio.c
index bf428ec..eea0b9a 100644
--- a/ratio.c
+++ b/ratio.c
@@ -129,20 +129,20 @@ rational power(rational r, unsigned int p){
return s;
}
-double to_double(rational r){
+double valuetype_to_double(rational r){
double i;
if(r.s) { i=-1.0; } else { i=1.0; }
return i*((double)r.n)/((double)r.d);
}
int to_string(char* s, rational r){
- double f = to_double(r);
+ double f = valuetype_to_double(r);
sprintf(s,"%llu / %llu = %f… +/- %6.1e",r.n,r.d,f,f*DBL_EPSILON);
return 0;
}
int root_to_string(char* s, rational r, unsigned int p){
- double f = pow(to_double(r),1.0/p);
+ double f = pow(valuetype_to_double(r),1.0/p);
sprintf(s,"(%llu / %llu)^1/%i = %f… +/- %6.1e",r.n,r.d,p,f,2*DBL_EPSILON*f);
return 0;
}
diff --git a/ratio.h b/ratio.h
index e273f7f..e555cfb 100644
--- a/ratio.h
+++ b/ratio.h
@@ -28,7 +28,7 @@ rational absolute(rational);
rational power(rational,unsigned int);
-double to_double(rational);
+double valuetype_to_double(rational);
int to_string(char*,rational r);