Skip to content

Commit a736b55

Browse files
author
José Valim
committed
Update CHANGELOG and remove warnings
1 parent 8720c56 commit a736b55

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Enhancements
44
* [Exception] Allow `exception/1` to be overriden and promote it as the main mechanism to customize exceptions
55
* [File] Add `File.stream_to!/3`
6+
* [Float] Add `Float.floor/1` and `Float.ceil/1`
67
* [Kernel] Add `List.delete_at/2` and `List.updated_at/3`
78
* [Kernel] Add `Enum.reverse/2`
89
* [Kernel] Implement `defmodule/2`, `@/1`, `def/2` and friends in Elixir itself. `case/2`, `try/2` and `receive/1` have been made special forms. `var!/1`, `var!/2` and `alias!/1` have also been implemented in Elixir and demoted from special forms
@@ -15,8 +16,10 @@
1516
* Bug fixes
1617
* [HashDict] Ensure a `HashDict` stored in an attribute can be accessed via the attribute
1718
* [Enum] Fix bug in `Enum.chunk/4` where you'd get an extra element when the enumerable was a multiple of the counter and a pad was given
19+
* [IEx] Ensure `c/2` helper works with full paths
1820
* [Kernel] `quote location: :keep` now only affects definitions in order to keep the proper trace in definition exceptions
1921
* [Mix] Also symlink `include` directories in _build dependencies
22+
* [Version] Fix `Version.match?/2` with `~>` and versions with alphanumeric build info (like `-dev`)
2023

2124
* Deprecations
2225
* [Enum] `Enumerable.count/1` and `Enumerable.member?/2` should now return tagged tuples. Please see `Enumerable` docs for more info

lib/elixir/lib/float.ex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ defmodule Float do
44
"""
55

66
@doc """
7-
Parses a binary into a float.
8-
7+
Parses a binary into a float.
8+
99
If successful, returns a tuple of the form `{ float, remainder_of_binary }`.
1010
Otherwise `:error`.
1111
@@ -85,6 +85,7 @@ defmodule Float do
8585
Round a float to the largest integer less than or equal to `num`
8686
8787
## Examples
88+
8889
iex> Float.floor(34)
8990
34
9091
iex> Float.floor(34.25)
@@ -99,14 +100,15 @@ defmodule Float do
99100
truncated = :erlang.trunc(num)
100101
case :erlang.abs(num - truncated) do
101102
x when x > 0 and num < 0 -> truncated - 1
102-
x -> truncated
103+
_ -> truncated
103104
end
104105
end
105106

106107
@doc """
107108
Round a float to the largest integer greater than or equal to `num`
108109
109110
## Examples
111+
110112
iex> Float.ceil(34)
111113
34
112114
iex> Float.ceil(34.25)
@@ -121,7 +123,7 @@ defmodule Float do
121123
truncated = :erlang.trunc(num)
122124
case :erlang.abs(num - truncated) do
123125
x when x > 0 and num > 0 -> truncated + 1
124-
x -> truncated
126+
_ -> truncated
125127
end
126128
end
127129

0 commit comments

Comments
 (0)