diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-24 21:44:09 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-24 15:03:18 +0200 |
| commit | 0e733d7e130cfb6a9ef174b1aea3760a8ce670e4 (patch) | |
| tree | 0f97d9ce88db85007b5d16753a4d3ab644b9c7ac /validation/linear/cast-constants.c | |
| parent | 8ed2cd6530fdd9858f32aae31e5a34cf9b6bb6a8 (diff) | |
| download | sparse-dev-0e733d7e130cfb6a9ef174b1aea3760a8ce670e4.tar.gz | |
use "%Le" to display floats
Floating-point values are displayed using the printf
format "%Lf" but this is the format without exponent
(and with default precision of 6 digit).
However, by its nature, this format is very imprecise.
For example, *all* values smaller than 0.5e-6 are displayed
as "0.000000".
Improve this by using the "%Le" format which always use
an exponent and thus maximize the precision.
Note: ultimately, we should display them exactly, for
example by using "%La", but this will requires C99.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/cast-constants.c')
| -rw-r--r-- | validation/linear/cast-constants.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/validation/linear/cast-constants.c b/validation/linear/cast-constants.c index 9e200672..c1fdab41 100644 --- a/validation/linear/cast-constants.c +++ b/validation/linear/cast-constants.c @@ -286,70 +286,70 @@ vptr_2_iptr: int_2_float: .L76: <entry-point> - setfval.32 %r39 <- 123.000000 + setfval.32 %r39 <- 1.230000e+02 ret.32 %r39 uint_2_float: .L78: <entry-point> - setfval.32 %r41 <- 123.000000 + setfval.32 %r41 <- 1.230000e+02 ret.32 %r41 long_2_float: .L80: <entry-point> - setfval.32 %r43 <- 123.000000 + setfval.32 %r43 <- 1.230000e+02 ret.32 %r43 ulong_2_float: .L82: <entry-point> - setfval.32 %r45 <- 123.000000 + setfval.32 %r45 <- 1.230000e+02 ret.32 %r45 double_2_float: .L84: <entry-point> - setfval.32 %r47 <- 1.123000 + setfval.32 %r47 <- 1.123000e+00 ret.32 %r47 int_2_double: .L86: <entry-point> - setfval.64 %r49 <- 123.000000 + setfval.64 %r49 <- 1.230000e+02 ret.64 %r49 uint_2_double: .L88: <entry-point> - setfval.64 %r51 <- 123.000000 + setfval.64 %r51 <- 1.230000e+02 ret.64 %r51 long_2_double: .L90: <entry-point> - setfval.64 %r53 <- 123.000000 + setfval.64 %r53 <- 1.230000e+02 ret.64 %r53 ulong_2_double: .L92: <entry-point> - setfval.64 %r55 <- 123.000000 + setfval.64 %r55 <- 1.230000e+02 ret.64 %r55 float_2_double: .L94: <entry-point> - setfval.64 %r57 <- 1.123000 + setfval.64 %r57 <- 1.123000e+00 ret.64 %r57 |
