From 634f01454f1c0f1a33adc50b5f584e39748ff832 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Sun, 28 Dec 2025 15:01:03 +0000 Subject: Print error exponential instead of floating. --- double-error.c | 2 +- ratio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/double-error.c b/double-error.c index 591a820..06d27ae 100644 --- a/double-error.c +++ b/double-error.c @@ -22,7 +22,7 @@ double_error to_exptype(double d){ } bool to_string(char* s, double_error de){ - sprintf(s,"%f +/- %.16f",de.v,de.e); + sprintf(s,"%f +/- %6.1e",de.v,de.e); return true; } diff --git a/ratio.c b/ratio.c index 243426d..07a28ce 100644 --- a/ratio.c +++ b/ratio.c @@ -129,6 +129,6 @@ double to_double(rational r){ bool to_string(char* s,rational r){ double f = to_double(r); - sprintf(s,"%llu / %llu = %f +- %.24f",r.n,r.d,f,f*DBL_EPSILON); + sprintf(s,"%llu / %llu = %f +/- %6.1e",r.n,r.d,f,f*DBL_EPSILON); return true; } -- cgit v1.2.3