Do not show floats in scientific notation if below 1.0e16 and the fractional value is precisely zero
Add Float.min_finite/0 and Float.max_finite/0
Module
15 changes across 11 versions
Changes by version
Do not show floats in scientific notation if below 1.0e16 and the fractional value is precisely zero
Add Float.min_finite/0 and Float.max_finite/0
Add Float.pow/2
Fix rounding for subnormal floats
Handle subnormal floats in Float.ratio/1
Introduce Float.ratio/1 that returns a tuple with the numerator and denominator as integers to retrieve the given float
Avoid multiple roundings in Float.ceil/2, Float.floor/2 and Float.round/2
Float.to_char_list/2 and Float.to_string/2 are deprecated (use the :erlang functions if such conversions are desired)
Float.to_string/2 and Float.to_char_list/2 has been soft-deprecated as Elixir will now attempt to print the shortest and most accurate representation by default. Developers can always fallback to :erlang.float_to_binary/2 and :erlang.float_to_list/2 if they need the previous functionality
Support complete scientific notation in Float.parse/1
Avoid rounding errors on Float.parse/1
Support precision in Float.ceil/1 and Float.floor/1
Float.ceil/2 and Float.floor/2 now always returns floats and no longer accept integers
Fix Float.parse/1 to handle numbers of the form "-0.x"
Add Float.floor/1, Float.ceil/1 and Float.round/3