summaryrefslogtreecommitdiff
path: root/ratio.c
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 /ratio.c
parent45fd7ef76536fdf78810e63f978bd3fc0be43537 (diff)
s/to_double/valuetype_to_double/g
Diffstat (limited to 'ratio.c')
-rw-r--r--ratio.c6
1 files changed, 3 insertions, 3 deletions
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;
}