diff options
author | Henrik Nord <[email protected]> | 2011-09-08 16:30:19 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-09-08 16:30:23 +0200 |
commit | 4273aeda2b9e64efac72a4c381fe56cdb2927dc8 (patch) | |
tree | fd6af7443b78bb43530affaea3afd2c35e1ebf2e /erts/doc/src | |
parent | 6ee4e2d478bfa34ccc11ac1c53a26d30fbe16cea (diff) | |
parent | 1b2cea397131a36a39b18c6ce8c6944bf11db4c7 (diff) | |
download | otp-4273aeda2b9e64efac72a4c381fe56cdb2927dc8.tar.gz otp-4273aeda2b9e64efac72a4c381fe56cdb2927dc8.tar.bz2 otp-4273aeda2b9e64efac72a4c381fe56cdb2927dc8.zip |
Merge branch 'fm/external_size_2' into dev
* fm/external_size_2:
Add erlang:external_size/2 BIF
OTP-9528
Diffstat (limited to 'erts/doc/src')
-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 ad7a57bd73..84d4160e6a 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -1035,6 +1035,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> |