external format

Vlad Dumitrescu vladdu@REDACTED
Mon Nov 6 10:51:49 CET 2000


Good morning to you all!

I have a question about the external format... Something seems to be weird
about it... Comparing the documentation and the code in for example
erl_interface/encode_long.c

---------------------------------------------------------------------------
2.15. SMALL_BIG_EXT     (110)
   1      1      1        n
+-----+-------+------+------------------+
| 110 |   n   | Sign |  d(0) ... d(n-1) |
+-----+-------+------+------------------+
2.16. LARGE_BIG_EXT     (111)
   1      4      1         n
+-----+-------+------+------------------+
| 111 |   n   | Sign |  d(0) ... d(n-1) |
+-----+-------+------+------------------+
---------------------------------------------------------------------------
      put8(s,ERL_SMALL_BIG_EXT);
      put8(s,4);          /* len = four bytes */
      put8(s, p < 0);            /* save sign separately */
      put32le(s, abs(p));        /* OBS: Little Endian, and p now positive
*/
---------------------------------------------------------------------------

Why a four-byte length for a SMALL_BIG_EXT?

Why isn't LARGE_BIG_EXT used at all?

Is there any support for the large integers in C code? I didn't find any...
The GNU MP library could be used here, if needed.

regards,
/Vlad
--------------------------------------------------------------
For God's sake, Smithers! It's not rocket
science, it's just brain surgery!
--------------------------------------------------------------



More information about the erlang-questions mailing list