[Aldor-l] Bigint bug(!)

pip88nl at gmail.com pip88nl at gmail.com
Fri Aug 15 19:15:18 EDT 2008


Hi,

bigint has a definite bug on twos complement systems. In xintStoreI,
which takes a signed long, the following code fails for LONG_MIN:

  u = (n < 0) ? -n : n;

LONG_MIN is -2147483648 on 32 bit platforms and on twos complement
systems, applying unary - to that will set the OF bit of the CFLAGS
register to 1 (it causes a signed overflow). How should we fix this? It
is a no-go to cause an assertion error on this.

Pippijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080816/9836ef2a/attachment-0002.bin>


More information about the Aldor-l mailing list