[Issue 9061] BigInt | BigInt, BigInt & int

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 7 10:01:20 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=9061



--- Comment #6 from Simen Kjaeraas <simen.kjaras at gmail.com> 2013-11-07 10:01:14 PST ---
(In reply to comment #5)
> This is what Python 2.6.5 answers to your questions:
> 
> >>> a = 0xB16B16B16B16B16B16B16B16B16
> >>> b = 4
> >>> c = a & ~b
> >>> c == 0xB16B16B16B16B16B16B16B16B12
> True
> 
> 
> >>> a = 0xB16B16B16B16B16B16B16B16B16
> >>> b = 4
> >>> c = a & b
> >>> c
> 4L
> >>> ~b
> -5

So basically SEX[0]. That sounds nice (heh), but how do we deal with uints?

Also, std.bigint.BigInt uses signed magnitude, whereas Python uses 2's
complement. Certainly it's possible to make BigInt behave the same as in
Python, but I'm unsure we want to. It's certainly a data point, though.

[0]: http://en.wikipedia.org/wiki/SEX_(computing)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list