Commit Graph

16 Commits

Author SHA1 Message Date
Jacek Sieka 9c51f9e7d5 use bitops2 from shims (#77) 2019-05-09 21:46:40 +02:00
mratsim 7591373f15 Enable modular arithmetic tests 2018-10-08 21:11:06 +00:00
mratsim 582466b625 Fix Generic Instantiation too nested in unittest (https://github.com/status-im/nim-stint/pull/66#issuecomment-427557655) + Renable all tests 2018-10-08 21:11:06 +00:00
mratsim f7fcecb395 Export marker + assign to result.data + fix forward decl and visibility issues introduced by the removal of the templates 2018-10-08 21:11:06 +00:00
Mamy Ratsimbazafy fd0482180f
Add bigint serialization (hex and decimal) (#29)
* Add serialization for decimal and hex

* Fix carry bug in signed add

* Add parsing test

* Improve highlow for int, remove most_significant_word_mut

* make conversion toString compile

* Add division corner case test

* Remove a buggy division shortcut

* Fix decimal string conversion

* Fix hex dumping

* Fix power of 2 division (what was I thinking?)

* Add hexdump test

* Move runtime check to compile-time

* Fix static assert check

* more compile-time asserts

* Fix parsing of negative hex numbers, add test_io to the suite

* dump default to bigEndian, split toString in Stint and Stuint

* Add (failing) tests with big ints conversion

* Temporarily remove all the noInit pragma
2018-04-30 13:38:55 +02:00
mratsim 6d2562ff5f Implement absolute value and signed modulo/division 2018-04-26 12:27:02 +02:00
mratsim 37ebd13dd4 Implement add, sub, neg with proper overflow detection 2018-04-25 21:21:58 +02:00
mratsim e2ab2dbf59 Add signed word iteration 2018-04-25 17:02:44 +02:00
Mamy Ratsimbazafy 24bd2fc986
Recursive init + bitwise as test + fix shr (#9)
* Recursive init compiles

* fix bitshift. Missing rolling over

* Strange shift required

* debug msg leftover
2018-03-28 20:45:39 +02:00
mratsim 8b8f2a55c4 Relicense under dual Apache/MIT 2018-03-02 11:48:08 +01:00
mratsim 6fd471f243 Add division test + consistent Subtype conversion use 2018-02-17 12:44:51 +01:00
mratsim 834ff19a25 Add comparison operators + tests + fix shr forward declaration 2018-02-16 17:48:54 +01:00
mratsim 02be5c3e90 [WIP] Add multiplication with Karatsuba algorithm + basic test 2018-02-16 09:22:23 +01:00
mratsim 4d7d5897cd Add substraction implementation 2018-02-15 23:28:31 +01:00
mratsim fc6483d42e Implement addition (including proper overflow behaviour) 2018-02-15 20:26:10 +01:00
mratsim 6f77899709 Add basic data structure, initialization and endianess test 2018-02-15 15:01:08 +01:00