bigints icon indicating copy to clipboard operation
bigints copied to clipboard

Why is this library not expected to work on 32 bit?

Open konsumlamm opened this issue 4 years ago • 6 comments

The readme states this under Current limitations and possible enhancements, but I don't see any obvious reason why this is the case. Could anyone elaborate on what exactly breaks on 32 bit platforms?

konsumlamm avatar Nov 29 '21 18:11 konsumlamm

I am assuming that is because in operations like realUnsignedAddition and multiplication you use a tmp variable that is a uint64 and I would not expect that to be available on a 32-bit architecture

pietroppeter avatar Nov 29 '21 18:11 pietroppeter

I've never heard of uint64 not being available on 32 bit platforms, it'll just be slower (since it's stored as two 32 bit values).

konsumlamm avatar Nov 29 '21 19:11 konsumlamm

You are right. That was my assumption, so maybe it works on a 32 bit system or it has another issue. What I can tell you is that I created that line in the readme starting from a todo file (now removed), saying "fix the library in 32 bit". See https://github.com/nim-lang/bigints/pull/32/files

Maybe @def- knows more about this?

pietroppeter avatar Nov 30 '21 08:11 pietroppeter

I think I added that since I found some bugs when running it on 32bit, I assume wrong results. But haven't tried in a while obviously, so not sure what the status is.

def- avatar Nov 30 '21 08:11 def-

I think I added that since I found some bugs when running it on 32bit, I assume wrong results. But haven't tried in a while obviously, so not sure what the status is.

Do you remember any specific examples that didn't work? If not, I don't think it makes much sense to keep the note about 32 bit.

konsumlamm avatar Nov 30 '21 14:11 konsumlamm

Just the internal tests I guess

def- avatar Nov 30 '21 14:11 def-