bignum support in ei?

Vance Shipley vances@REDACTED
Thu Jun 12 04:20:44 CEST 2003


On Thu, Jun 12, 2003 at 01:35:23AM +0200, Kent Boortz wrote:
}  
}  You mean an Erlang integer that don't fit in a C long or unsigned long?
}  No, there is no way to decode this in the current version of ei.

Actually I was trying to send 16#ffffffff which is 32 bits no?

It would appear that if the upper nibble of a 32 bit integer is not zero
it becomes an ERL_SMALL_BIG_EXT:

}  > 16#07ffffff       134217727                          ERL_INTEGER_EXT
}  > 16#08ffffff       #integer(2) = {65535,2303}         ERL_SMALL_BIG_EXT
...
}  > Seems like a strange place to make the last break but anyway.
}  
}  What do you mean? What break and why is it strange?

Seems strange to me.  Why can I send this 32 bit value:

	0000 1111 1111 1111 1111 1111 1111 1111

but not this one (without becoming a bignum):

	0001 1111 1111 1111 1111 1111 1111 1111

}  In R9C there will be a ei_decode_longlong() and ei_decode_ulonglong(),
}  e.i. 64-bit integers.
  
I was wondering what would happen on a 64-bit emulator.

The R9C changes sound good.  I can wait, in the mean time I'm just
working around the limitation for an all ones 32 value.

	-Vance



More information about the erlang-questions mailing list