Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/elixir/lib/float.ex
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ defmodule Float do
"""
@spec to_charlist(float) :: charlist
def to_charlist(float) when is_float(float) do
:io_lib_format.fwrite_g(float)
:erlang.float_to_list(float, [:short])
end

@doc """
Expand All @@ -603,7 +603,7 @@ defmodule Float do
"""
@spec to_string(float) :: String.t()
def to_string(float) when is_float(float) do
IO.iodata_to_binary(:io_lib_format.fwrite_g(float))
:erlang.float_to_binary(float, [:short])
end

@doc false
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/lib/inspect.ex
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ defimpl Inspect, for: Float do
if abs >= 1.0 and abs < 1.0e16 and trunc(float) == float do
[Integer.to_string(trunc(float)), ?., ?0]
else
:io_lib_format.fwrite_g(float)
:erlang.float_to_list(float, [:short])
end

color(IO.iodata_to_binary(formatted), :number, opts)
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/lib/list/chars.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ end

defimpl List.Chars, for: Float do
def to_charlist(term) do
:io_lib_format.fwrite_g(term)
:erlang.float_to_list(term, [:short])
end
end
2 changes: 1 addition & 1 deletion lib/elixir/lib/string/chars.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ end

defimpl String.Chars, for: Float do
def to_string(term) do
IO.iodata_to_binary(:io_lib_format.fwrite_g(term))
:erlang.float_to_binary(term, [:short])
end
end