diff options
| author | Julian Weigt <juw@posteo.de> | 2025-12-28 15:01:03 +0000 |
|---|---|---|
| committer | Julian Weigt <juw@posteo.de> | 2026-02-04 15:55:49 +0100 |
| commit | 634f01454f1c0f1a33adc50b5f584e39748ff832 (patch) | |
| tree | a1ddef4c745fdbca225cf10757c0d10522e8d4fa | |
| parent | 1c08f5b7149bdd3ff02c1d1f7f41419e6e813a7c (diff) | |
Print error exponential instead of floating.
| -rw-r--r-- | double-error.c | 2 | ||||
| -rw-r--r-- | 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; } @@ -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; } |
