Closed AaronKutch closed 6 years ago
Thank you for your bug report! I will look into this and comment more thoroughly tomorrow - it is very late here. ;)
My application relies on there being no edge cases or unexpected behavior, so you can expect more in the future. Do have plans for fixing the unimplemented parts in the next month or so? I can perform inefficient mult and div functions on my side so actually I can start using the crate right away. I am using your crate to make large integers with behaviors just like the primitives. Also, can you make a function that returns the bit width of the ApInt? It would make some things easier for me.
You can get the bit width of an ApInt
, Int
or Uint
instance by using the Width
trait with its width
method. For this, however, you have to explicitely import (use) it with use apint::Width;
otherwise it is not visible to you. This is unergonomic and might improve in future versions.
I am using the apint crate myself in stevia so it is also important for my other project that the apint crate improves. :)
I will try to fix the reported bugs in the apint crate next weekend (maybe even earlier) and also try to implement multiplication and division routines for large apint instances as well. However, PRs are generally welcome, too. :)
I have fixed the reported bug in version 0.1.0 of the crate.
If I were you, I would add tests for the problematic {integer}::MIN values everywhere applicable.
Also, I found this in the documentation:
It should be 128 not 64.
Also, now that i128 is stabilized (except for repr(i128)), check that the implementation and docs of all the i128 stuff is also correct.
This crate perfectly fits my use case (and I think that it is much, much better than the
num_bigint
crate in general), but there is some unimplemented! stuff in the multiply and divide functions that prevents me from using it.