Skip to content
Merged
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
2 changes: 1 addition & 1 deletion lib/elixir/lib/float.ex
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ defmodule Float do
@spec round(float, precision_range) :: float
def round(float, precision \\ 0)

def round(float, 0) when float == 0.0, do: float
def round(float, 0) when float === 0.0 or float === -0.0, do: float

def round(float, 0) when is_float(float) do
case :erlang.round(float) * 1.0 do
Expand Down
Loading