diff options
author | Henrik Nord <[email protected]> | 2011-09-08 16:36:26 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-09-08 16:36:26 +0200 |
commit | f602ae4f0c727c1ff37e69887ba33f46b24c54e1 (patch) | |
tree | 340525e4b69e6971854de896b4f64d70b2224b0a /erts/doc/src/erlang.xml | |
parent | 6fae573fc291f4a77282b918cae346064bece80e (diff) | |
parent | 262a9af33d3ceb4cb032c434b100cea7d4b0d60e (diff) | |
download | otp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.tar.gz otp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.tar.bz2 otp-f602ae4f0c727c1ff37e69887ba33f46b24c54e1.zip |
Merge branch 'dev' into major
Diffstat (limited to 'erts/doc/src/erlang.xml')
-rw-r--r-- | erts/doc/src/erlang.xml | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index 79dc6838a6..7fba12aae0 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1026,6 +1026,56 @@ b</pre> </desc> </func> <func> + <name>erlang:external_size(Term) -> integer() >= 0</name> + <fsummary>Calculate the maximum size for a term encoded in the Erlang + external term format</fsummary> + <type> + <v>Term = term()</v> + </type> + <desc> + <p>Calculates, without doing the encoding, the maximum byte size for + a term encoded in the Erlang external term format. The following + condition applies always:</p> + <p> + <pre> +> <input>Size1 = byte_size(term_to_binary(Term)),</input> +> <input>Size2 = erlang:external_size(Term),</input> +> <input>true = Size1 =< Size2.</input> +true + </pre> + </p> + <p>This is equivalent to a call to: <code>erlang:external_size(Term, []) + </code></p> + </desc> + </func> + <func> + <name>erlang:external_size(Term, [Option]) -> integer() >= 0</name> + <fsummary>Calculate the maximum size for a term encoded in the Erlang + external term format</fsummary> + <type> + <v>Term = term()</v> + <v>Option = {minor_version, Version}</v> + </type> + <desc> + <p>Calculates, without doing the encoding, the maximum byte size for + a term encoded in the Erlang external term format. The following + condition applies always:</p> + <p> + <pre> +> <input>Size1 = byte_size(term_to_binary(Term, Options)),</input> +> <input>Size2 = erlang:external_size(Term, Options),</input> +> <input>true = Size1 =< Size2.</input> +true + </pre> + </p> + <p>The option <c>{minor_version, Version}</c> specifies how floats + are encoded. See + <seealso marker="#term_to_binary/2">term_to_binary/2</seealso> for + a more detailed description. + </p> + </desc> + </func> + <func> <name>float(Number) -> float()</name> <fsummary>Convert a number to a float</fsummary> <type> |