3 ms·
I would be very interested in the test suite you used. I've finished my own bigint implementation in the Nim language: - stack and power-of-2 only for uint256
by mratsim 8y ago
I would be very interested in the test suite you used.
I've finished my own bigint implementation in the Nim language:
- stack and power-of-2 only for uint256, uint512, uint1024, etc),
- using recursive types (uint128 = 2x uint64, uint256 = 2x uint128).
It is already quite optimized (division using Burnikel and Ziegler recursive division for example), but I want to make sure it works fine.
https://github.com/status-im/nim-stint https://github.com/status-im/nim-stint
- judofyr 8y agoInteresting approach. If I understand your library correctly, you need to choose a bitsize at compile-time? I thought you often wanted unlimited precision (aka. possibly heap-allocated) when using bigints?
- mratsim 8y agoIndeed, in my case I didn't need arbitrary precision, just extending uint64 to uint128, uint256, uint512, ... Fixed size are perfectly fine for a variety of use cases, can be stack-allocated and are much faster due to the specialization.