bigints icon indicating copy to clipboard operation
bigints copied to clipboard

BigInts for Nim

Results 28 bigints issues
Sort by recently updated
recently updated
newest added

It would be useful to add some benchmarks, so that we can measure performance improvements/degradations for changes.

BigInt objects don't work with the rationals module, because initRational expects SomeInteger which BigInt isn't. Looking through the code for rationals, it looks like the only function it needs that...

This is still a draft. I get a strange error in one test of the tliterals.nim file. I have no clue why this test is wrong when I switch the...

The behaviour of `div` and `mod` is currently inconsistent with the respective operators for `int`s. For example: ```nim import bigints func divmod(a, b: int): tuple[q, r: int] = (q: a...

Fixes Feature request: toBiggestInt #34

This PR adds `setBit`, `clearBit` and `testBit` procs. They are same to `setBit`, `clearBit` and `testBit` in `std/bitops`.

Currently, e.g. `+=` is defined as ```nim template `+=`*(a: var BigInt, b: BigInt) = a = a + b ``` This causes `a` to be evaluated twice, which can produce...

The most significant change is turning let into const - a huge amount of temporaries goes away. Other is porting from strutils to strformat. And using 'bi when possible

I would like a function to generate a *uniformly* (as much as possible) random BigInt inferior to some upper bound. This would enable to randomize tests.