Commit Graph

19 Commits

Author SHA1 Message Date
Mamy André-Ratsimbazafy 7f6c588ce3
Passing addition tests (however simple bitwise ops crash the int128 VM ... during compilation) 2023-06-12 17:08:20 +07:00
Mamy André-Ratsimbazafy a0dec54c12
Implement multiplication 2023-06-12 17:08:20 +07:00
Mamy André-Ratsimbazafy 206ffa92cf
Implement multiprecision addition / substraction 2023-06-12 17:08:19 +07:00
Mamy André-Ratsimbazafy cbbffe4e9c
reimplement bitwise 2023-06-12 17:08:19 +07:00
Mamy André-Ratsimbazafy 36cc2b2e02
Implement comparison 2023-06-12 17:08:19 +07:00
Mamy André-Ratsimbazafy de87739635
Implement types and uint128 primitives 2023-06-12 17:08:19 +07:00
Jacek Sieka c05f75a8da
comment style fix 2022-04-07 09:53:11 +02:00
Timothee Cour 484031fdff fix stint for https://github.com/nim-lang/Nim/pull/18050 2021-07-01 13:16:07 +03:00
andri lim 21dc4c6519 compile time truncate and dumpHex 2019-10-23 21:55:47 +09:00
Jacek Sieka c5247e9d88
stew updates (#82)
* simplify int api (fixes #68)
* implement endians api
* implement some more bitops
2019-07-22 09:53:58 +02:00
Jacek Sieka 360d01d170 Better bitsof implementation (#74)
See https://github.com/nim-lang/Nim/issues/9494
2019-01-07 20:11:45 +01:00
mratsim 308ed51d59 Add 8192-bit overloads 2018-12-04 15:42:00 +01:00
mratsim fa37d957e9 Add one more bitsof overload to support Uint4096 2018-12-04 14:33:19 +01:00
Jacek Sieka edb1ade373
add a few more overloads for calculating bitset size (for eth-bloom) 2018-11-07 09:18:25 -06:00
Jacek Sieka 9027fbea3e
refactoring away for loop macros
* remove experimental for loop macro usage
* make implementation of several operations follow data structure
(recursive data -> recursive implementation)
* rename getSize -> bitsof to avoid bits vs bytes confusion
* fix potential 32-bit issue where asSignedWords cast to `int` even when
`uint64` was used as storage
* `hi` for signed ints now is signed - this replaces `asSignedWords` and
makes several int operations more natural
* fix bit size assert
2018-10-25 12:58:40 +02:00
mratsim 65729901db Review: add comment about where Stint is not ideal 2018-10-08 21:11:06 +00:00
mratsim 5980477e0b Add a description and why choosing a recursive impl for Stint 2018-10-08 21:11:06 +00:00
mratsim 7fa6329d4c Change the test flag from mpint_test to stint_test 2018-10-08 21:11:06 +00:00
Yuriy Glukhov ad09fe3a94 Corrected package structure 2018-05-08 17:42:42 +03:00