Skip to content

Commit 9c28fb7

Browse files
committed
Improve JSON and Float docs
1 parent cda1a09 commit 9c28fb7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/elixir/lib/float.ex

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -577,15 +577,9 @@ defmodule Float do
577577
Returns a charlist which corresponds to the shortest text representation
578578
of the given float.
579579
580-
The underlying algorithm changes depending on the Erlang/OTP version:
581-
582-
* For OTP >= 24, it uses the algorithm presented in "Ryū: fast
583-
float-to-string conversion" in Proceedings of the SIGPLAN '2018
584-
Conference on Programming Language Design and Implementation.
585-
586-
* For OTP < 24, it uses the algorithm presented in "Printing Floating-Point
587-
Numbers Quickly and Accurately" in Proceedings of the SIGPLAN '1996
588-
Conference on Programming Language Design and Implementation.
580+
It uses the algorithm presented in "Ryū: fast float-to-string conversion"
581+
in Proceedings of the SIGPLAN '2018 Conference on Programming Language
582+
Design and Implementation.
589583
590584
For a configurable representation, use `:erlang.float_to_list/2`.
591585

lib/elixir/lib/json.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ defmodule JSON do
328328
The second argument is a function that is recursively
329329
invoked to encode a term.
330330
331+
> #### IO and performance {: .tip}
332+
>
333+
> If you need to encode data to be sent over the network
334+
> or written to the filesystem, consider using the more
335+
> efficient `encode_to_iodata!/2`.
336+
331337
## Examples
332338
333339
iex> JSON.encode!([123, "string", %{key: "value"}])

0 commit comments

Comments
 (0)