Commit Graph

99 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy 53d2fd14f3
uint division - compile and pass the single limb tests 2023-06-12 17:11:13 +07:00
Mamy Ratsimbazafy c2ed8a4bc2
stash div refactor 2023-06-12 17:11:09 +07:00
Mamy André-Ratsimbazafy f952314c21
dump progress 2023-06-12 17:08:22 +07:00
Mamy André-Ratsimbazafy dd3ab71029
For division we need internal add/sub/shift/bitwise so create internal files [skip-ci] 2023-06-12 17:08:21 +07:00
Mamy André-Ratsimbazafy dc9e0a43ca
Implement exponentiation, test mul, split mul/div tests 2023-06-12 17:08:21 +07:00
Mamy André-Ratsimbazafy 254d4da649
Pass extended precision bitops2 tests 2023-06-12 17:08:21 +07:00
Mamy André-Ratsimbazafy 59bca47012
Fix comparison operators 2023-06-12 17:08:21 +07:00
Mamy André-Ratsimbazafy 3df7f38260
Fix noInit issue at runtime, pass the bitwise tests 2023-06-12 17:08:21 +07:00
Mamy André-Ratsimbazafy 195480d58a
passing compile-time bitwise tests (but not runtime :?) 2023-06-12 17:08:20 +07:00
Mamy André-Ratsimbazafy 777a84e9f5
Implement toHex/fromHex and fix `shl` 2023-06-12 17:08:20 +07:00
Mamy André-Ratsimbazafy 2ac1ee3f1e
Fix compiletime primitives to pass all bitwise tests except large shifts 2023-06-12 17:08:20 +07:00
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
tersec 95b91474ce
remove Nim 1.2 and 1.4 support 2023-06-08 11:08:27 +00:00
tersec 86621eced1
remove pre-Nim 1.2 support (#127) 2023-06-05 11:42:36 +00:00
jangko 493f31de63
reduce compiler warnings 2023-02-23 12:09:45 +07:00
tersec 3472a16fbc
avoid deprecation warnings on Nim 1.6 when using (#121) 2023-02-07 13:41:40 +01:00
G f36623998f
fix(skipPrefixes): fix erroneous strip of 0b in hex numbers (#120)
* fix(skipPrefixes): fix erroneous strip of 0b in hex numbers

* refactor(skipPrefixes): normalize radix checks

* feat(stint): add tests for bin, oct, hex string conversions

* fix(stint): fix cast

* fix(stint): fix typo

* fix(stint): alternative format

* feat(stint): add test

* fix(stint): fix stint width in test
2022-10-03 12:15:45 +02:00
Jacek Sieka c05f75a8da
comment style fix 2022-04-07 09:53:11 +02:00
Kim De Mey e656ad40d1
Enable --styleCheck:usages (#118) 2022-02-24 20:09:53 +01:00
Mamy Ratsimbazafy 49d11d61b8
RangeError are actually defect and not catchable. (#111)
* RangeError are actually defect and not catchable.

* Don't use range types at runtime they throw RangeDefect
2021-10-08 10:08:56 +02:00
Mamy Ratsimbazafy 06e5c4829c
Parsing should raise CatchableError for user inputs (#110) 2021-10-06 18:53:52 +02:00
Timothee Cour 484031fdff fix stint for https://github.com/nim-lang/Nim/pull/18050 2021-07-01 13:16:07 +03:00
zah 9e49b00148 Define a hash function in order to support Stint keys in hash tables (#102)
* Hash stint values as byte blobs; Add a basic test for using stint keys in a table
2019-12-18 14:02:16 +01:00
andri lim f0da0406f0 tidying up range check in constructor 2019-12-13 16:19:41 +02:00
andri lim d98b77c88d fixes #94, implement conversion constructor 2019-12-13 16:19:41 +02:00
andri lim 25c2604b4b cosmetics changes 2019-10-25 19:54:41 +03:00
andri lim 9ec615f0ef disable powmod at compile time 2019-10-25 19:54:41 +03:00
andri lim 2b5d083dac fixes 32bit problem 2019-10-25 19:54:41 +03:00
andri lim 7fe4db62dc add compiletime test for signed int dumphex 2019-10-25 19:54:41 +03:00
andri lim 59acce63b7 fixes intops.shr for Nim 0.19.6 2019-10-23 21:55:47 +09:00
andri lim 0ee6dc5c6a convert runtime signed int mul to vm friendly 2019-10-23 21:55:47 +09:00
andri lim 962932dd6a fixes isNegative only for signed integer 2019-10-23 21:55:47 +09:00
andri lim 7dc26bb714 signed integer 'fromHex' 2019-10-23 21:55:47 +09:00
andri lim 79dfae7d32 fixes typo 2019-10-23 21:55:47 +09:00
andri lim 0cd6b2a052 improve io test coverage + compile time test 2019-10-23 21:55:47 +09:00
andri lim d67cee6f8d tidying up compiletime helpers 2019-10-23 21:55:47 +09:00
andri lim f5116945e6 move compile time convertImpl to compiletile helpers 2019-10-23 21:55:47 +09:00
andri lim affbe30b41 implement compile time helpers 2019-10-23 21:55:47 +09:00
andri lim 0b06077c55 compile time toBytes 2019-10-23 21:55:47 +09:00
andri lim 21dc4c6519 compile time truncate and dumpHex 2019-10-23 21:55:47 +09:00
andri lim 6eb7b7054e
fixes related to Nim v1.0.2 32 bit type inference rule modification 2019-10-19 16:56:18 +07:00
andri lim e084bb7d9d
using tuple comparison when checking for nim version instead of template 2019-08-07 21:28:33 +07:00
andri lim 173699583b
fix #81 remove ashr from API and fix shr on Nim 0.20 2019-08-06 20:25:48 +07:00
Jacek Sieka d154bcf90a
reexport isEven and friends 2019-07-22 10:17:58 +02: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