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
let string_of_float f = valid_float_lexem (format_float !float_fmt f);;
and allow Pervasives.float_fmt be user accessible? Would this slow
things down much?
My feeling is that if you care about your floating-point results,
you'll eventually want to display them using printf and the format
appropriate (in precision and style) for your results.
string_of_float is more of a convenience function when one just wants
some printable approximation of a float, e.g. for tracing or logging,
but doesn't really care how good the approximation is.
Original bug ID: 1779
Reporter: administrator
Status: closed
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Why not make string_of_float be
let float_fmt = ref "%.17g";;
let string_of_float f = valid_float_lexem (format_float !float_fmt f);;
and allow Pervasives.float_fmt be user accessible? Would this slow
things down much?
The text was updated successfully, but these errors were encountered: