aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erlang.xml
diff options
context:
space:
mode:
Diffstat (limited to 'erts/doc/src/erlang.xml')
-rw-r--r--erts/doc/src/erlang.xml59
1 files changed, 47 insertions, 12 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 1d67be2e52..b336a135e7 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2012</year>
+ <year>1996</year><year>2013</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -277,7 +277,9 @@
the binary contains Unicode characters greater than 16#FF.
In a future release, such Unicode characters might be allowed
and <c>binary_to_atom(<anno>Binary</anno>, utf8)</c>
- will not fail in that case.</p></note>
+ will not fail in that case. For more information on Unicode support in atoms
+ see <seealso marker="erl_ext_dist#utf8_atoms">note on UTF-8 encoded atoms</seealso>
+ in the chapter about the external term format in the ERTS User's Guide.</p></note>
<pre>
> <input>binary_to_atom(&lt;&lt;"Erlang"&gt;&gt;, latin1).</input>
@@ -968,6 +970,37 @@ true
</desc>
</func>
<func>
+ <name>float_to_list(Float, Options) -> string()</name>
+ <fsummary>Text representation of a float formatted using given options</fsummary>
+ <type>
+ <v>Float = float()</v>
+ <v>Options = [Option]</v>
+ <v>Option = {decimals, Decimals::0..249} |
+ {scientific, Decimals::0..249} |
+ compact</v>
+ </type>
+ <desc>
+ <p>Returns a string which corresponds to the text
+ representation of <c>Float</c> using fixed decimal point formatting.
+ When <c>decimals</c> option is specified
+ the returned value will contain at most <c>Decimals</c> number of
+ digits past the decimal point. If the number doesn't fit in the
+ internal static buffer of 256 bytes, the function throws <c>badarg</c>.
+ When <c>compact</c> option is provided
+ the trailing zeros at the end of the list are truncated (this option is
+ only meaningful together with the <c>decimals</c> option). When
+ <c>scientific</c> option is provided, the float will be formatted using
+ scientific notation with <c>Decimals</c> digits of precision. If
+ <c>Options</c> is <c>[]</c> the function behaves like <c>float_to_list/1</c>.
+ </p>
+ <pre>
+> <input>float_to_list(7.12, [{decimals, 4}]).</input>
+"7.1200"
+> <input>float_to_list(7.12, [{decimals, 4}, compact]).</input>
+"7.12"</pre>
+ </desc>
+ </func>
+ <func>
<name name="fun_info" arity="1"/>
<fsummary>Information about a fun</fsummary>
<desc>
@@ -1681,9 +1714,11 @@ os_prompt% </pre>
<desc>
<p>Returns the atom whose text representation is <c><anno>String</anno></c>.</p>
<p><c><anno>String</anno></c> may only contain ISO-latin-1
- characterns (i.e. numbers below 256) as the current
+ characters (i.e. numbers below 256) as the current
implementation does not allow unicode characters >= 256 in
- atoms.</p>
+ atoms. For more information on Unicode support in atoms
+ see <seealso marker="erl_ext_dist#utf8_atoms">note on UTF-8 encoded atoms</seealso>
+ in the chapter about the external term format in the ERTS User's Guide.</p>
<pre>
> <input>list_to_atom("Erlang").</input>
'Erlang'</pre>
@@ -5679,35 +5714,35 @@ ok
For more information see the
<seealso marker="erl#+spp">+spp</seealso> command line argument
of <seealso marker="erl">erl(1)</seealso>.</p></item>
- <tag><c>process_count</c></tag>
+ <tag><marker id="system_info_port_count"/><c>port_count</c></tag>
<item>
<p>Returns the number of ports currently existing at
the local node as an integer. The same value as
- <c>length(erlang:ports())</c> returns.</p>
+ <c>length(erlang:ports())</c> returns, but more efficient.</p>
</item>
<tag><marker id="system_info_port_limit"><c>port_limit</c></marker></tag>
<item>
<p>Returns the maximum number of simultaneously existing
ports at the local node as an integer. This limit
can be configured at startup by using the
- <seealso marker="erl#max_ports"><c>+Q</c></seealso>
+ <seealso marker="erl#+Q">+Q</seealso>
command line flag of
- <seealso marker="erl"><c>erl(1)</c></seealso>.</p>
+ <seealso marker="erl">erl(1)</seealso>.</p>
</item>
- <tag><c>process_count</c></tag>
+ <tag><marker id="system_info_process_count"/><c>process_count</c></tag>
<item>
<p>Returns the number of processes currently existing at
the local node as an integer. The same value as
- <c>length(processes())</c> returns.</p>
+ <c>length(processes())</c> returns, but more efficient.</p>
</item>
<tag><marker id="system_info_process_limit"><c>process_limit</c></marker></tag>
<item>
<p>Returns the maximum number of simultaneously existing
processes at the local node as an integer. This limit
can be configured at startup by using the
- <seealso marker="erl#max_processes"><c>+P</c></seealso>
+ <seealso marker="erl#+P">+P</seealso>
command line flag of
- <seealso marker="erl"><c>erl(1)</c></seealso>.</p>
+ <seealso marker="erl">erl(1)</seealso>.</p>
</item>
<tag><c>procs</c></tag>
<item>