@@ -981,28 +981,31 @@ end
981
981
# Hack to use @printf with a format depending on the `Floatmu` used.
982
982
# Since @printf is a macro, it cannot be called with anything other than a constant
983
983
# for the format string.
984
- variable_printf (io,x:: Floatmu{szE,2} ) where {szE} = @printf (io," %.3g" ,convert (Float64,x))
984
+ # The number of digits used to display a value is chosen so as to ensure
985
+ # a correct round-trip (``In-and-out conversions'', David Matula,
986
+ # Comm. ACM, 11(1), Jan. 1968)
987
+ variable_printf (io,x:: Floatmu{szE,2} ) where {szE} = @printf (io," %.2g" ,convert (Float64,x))
985
988
variable_printf (io,x:: Floatmu{szE,3} ) where {szE} = @printf (io," %.3g" ,convert (Float64,x))
986
989
variable_printf (io,x:: Floatmu{szE,4} ) where {szE} = @printf (io," %.3g" ,convert (Float64,x))
987
990
variable_printf (io,x:: Floatmu{szE,5} ) where {szE} = @printf (io," %.3g" ,convert (Float64,x))
988
- variable_printf (io,x:: Floatmu{szE,6} ) where {szE} = @printf (io," %.3g " ,convert (Float64,x))
989
- variable_printf (io,x:: Floatmu{szE,7} ) where {szE} = @printf (io," %.3g " ,convert (Float64,x))
990
- variable_printf (io,x:: Floatmu{szE,8} ) where {szE} = @printf (io," %.3g " ,convert (Float64,x))
991
- variable_printf (io,x:: Floatmu{szE,9} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
992
- variable_printf (io,x:: Floatmu{szE,10} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
993
- variable_printf (io,x:: Floatmu{szE,11} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
994
- variable_printf (io,x:: Floatmu{szE,12} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
995
- variable_printf (io,x:: Floatmu{szE,13} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
996
- variable_printf (io,x:: Floatmu{szE,14} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
997
- variable_printf (io,x:: Floatmu{szE,15} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
998
- variable_printf (io,x:: Floatmu{szE,16} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
999
- variable_printf (io,x:: Floatmu{szE,17} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
1000
- variable_printf (io,x:: Floatmu{szE,18} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
1001
- variable_printf (io,x:: Floatmu{szE,19} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1002
- variable_printf (io,x:: Floatmu{szE,20} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1003
- variable_printf (io,x:: Floatmu{szE,21} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1004
- variable_printf (io,x:: Floatmu{szE,22} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1005
- variable_printf (io,x:: Floatmu{szE,23} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
991
+ variable_printf (io,x:: Floatmu{szE,6} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
992
+ variable_printf (io,x:: Floatmu{szE,7} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
993
+ variable_printf (io,x:: Floatmu{szE,8} ) where {szE} = @printf (io," %.4g " ,convert (Float64,x))
994
+ variable_printf (io,x:: Floatmu{szE,9} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
995
+ variable_printf (io,x:: Floatmu{szE,10} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
996
+ variable_printf (io,x:: Floatmu{szE,11} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
997
+ variable_printf (io,x:: Floatmu{szE,12} ) where {szE} = @printf (io," %.5g " ,convert (Float64,x))
998
+ variable_printf (io,x:: Floatmu{szE,13} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
999
+ variable_printf (io,x:: Floatmu{szE,14} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
1000
+ variable_printf (io,x:: Floatmu{szE,15} ) where {szE} = @printf (io," %.6g " ,convert (Float64,x))
1001
+ variable_printf (io,x:: Floatmu{szE,16} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1002
+ variable_printf (io,x:: Floatmu{szE,17} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1003
+ variable_printf (io,x:: Floatmu{szE,18} ) where {szE} = @printf (io," %.7g " ,convert (Float64,x))
1004
+ variable_printf (io,x:: Floatmu{szE,19} ) where {szE} = @printf (io," %.8g " ,convert (Float64,x))
1005
+ variable_printf (io,x:: Floatmu{szE,20} ) where {szE} = @printf (io," %.8g " ,convert (Float64,x))
1006
+ variable_printf (io,x:: Floatmu{szE,21} ) where {szE} = @printf (io," %.8g " ,convert (Float64,x))
1007
+ variable_printf (io,x:: Floatmu{szE,22} ) where {szE} = @printf (io," %.8g " ,convert (Float64,x))
1008
+ variable_printf (io,x:: Floatmu{szE,23} ) where {szE} = @printf (io," %.9g " ,convert (Float64,x))
1006
1009
1007
1010
1008
1011
function show (io:: IO , x:: Floatmu{szE,szf} ) where {szE, szf}
0 commit comments