summaryrefslogtreecommitdiff
path: root/ratio.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratio.c')
-rw-r--r--ratio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ratio.c b/ratio.c
index 3bb5ef3..bf428ec 100644
--- a/ratio.c
+++ b/ratio.c
@@ -135,14 +135,14 @@ double to_double(rational r){
return i*((double)r.n)/((double)r.d);
}
-bool to_string(char* s, rational r){
+int to_string(char* s, rational r){
double f = to_double(r);
sprintf(s,"%llu / %llu = %f… +/- %6.1e",r.n,r.d,f,f*DBL_EPSILON);
- return true;
+ return 0;
}
-bool root_to_string(char* s, rational r, unsigned int p){
+int root_to_string(char* s, rational r, unsigned int p){
double f = pow(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 true;
+ return 0;
}