You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be logical consistency in how many significant digits are printed or shown as the result. This maybe different to the actual evaluated result (which may have floating point issues).
Eg.
julia> apisrs =load_data("apisrs");
julia> srs =SurveyDesign(apisrs; weights =:pw) |> bootweights
julia> tot =total(:api00, srs)
1×2 DataFrame
Row │ total SE
│ Float64 Float64
─────┼────────────────────
1 │ 4.06689e657644.8
julia> mn =mean(:api00, srs)
1×2 DataFrame
Row │ mean SE
│ Float64 Float64
─────┼──────────────────
1 │ 656.5859.30656
Above, 656.585 is printed answer, but the actual evaluated value is 656.5849999999991.
There is a way to configure your REPL using IOContext. The relevant option in our case is probably :compact, but that is already set to true by default. There is no option to choose whether to suppress scientific notation of not (at least I couldn't find one). See also this discussion or the Julia documentation for prompt modes. Maybe printf can also be used for this purpose, although I don't really see how. This is not exactly what you're saying, since this is something that the user must configure, not a standard that we can give.
However, I don't think we need this standard. Maybe there's a way to suppress scientific notation, but I don't think we should enforce this in our package. The user can configure this on their own, the way they prefer it. This is more a matter of taste.
There should be logical consistency in how many significant digits are printed or shown as the result. This maybe different to the actual evaluated result (which may have floating point issues).
Eg.
Above, 656.585 is printed answer, but the actual evaluated value is 656.5849999999991.
In R
What can be suitable strategy for consistent printing?
The text was updated successfully, but these errors were encountered: