Skip to content

Commit

Permalink
Improve JSON and Float docs
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 11, 2024
1 parent b0951f3 commit 4233693
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/elixir/lib/float.ex
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,9 @@ defmodule Float do
Returns a charlist which corresponds to the shortest text representation
of the given float.
The underlying algorithm changes depending on the Erlang/OTP version:
* For OTP >= 24, it uses the algorithm presented in "Ryū: fast
float-to-string conversion" in Proceedings of the SIGPLAN '2018
Conference on Programming Language Design and Implementation.
* For OTP < 24, it uses the algorithm presented in "Printing Floating-Point
Numbers Quickly and Accurately" in Proceedings of the SIGPLAN '1996
Conference on Programming Language Design and Implementation.
It uses the algorithm presented in "Ryū: fast float-to-string conversion"
in Proceedings of the SIGPLAN '2018 Conference on Programming Language
Design and Implementation.
For a configurable representation, use `:erlang.float_to_list/2`.
Expand Down
6 changes: 6 additions & 0 deletions lib/elixir/lib/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,12 @@ defmodule JSON do
The second argument is a function that is recursively
invoked to encode a term.
> #### IO and performance {: .tip}
>
> If you need to encode data to be sent over the network
> or written to the filesystem, consider using the more
> efficient `encode_to_iodata!/2`.
## Examples
iex> JSON.encode!([123, "string", %{key: "value"}])
Expand Down

0 comments on commit 4233693

Please sign in to comment.