Big integers sign bit representation

Hello,
I was going through the internal representation of integers in erlangVM. It uses 2’s complement to represent the signed integer when the number is an immediate term. But when big integers are represented as boxed terms, I think sign-magnitude is used to represent the signed integers. Can someone please confirm if this is right.

Thank you.

That is correct. It is done that way in order to be able to use big integer algorithms like Karatsuba.

6 Likes