Commit Graph

10 Commits

Author SHA1 Message Date
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 7bbe7d8f9f Fix doc of toInt/toUint + add more docs about undefined behaviours 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
mratsim ede5b57fa4 Improve uint public API: no template + documentation 2018-10-08 21:11:06 +00:00
Mamy Ratsimbazafy 184e22b659
Compile-time creation of Uint (#53)
* Start on allowing compile-time stint. Works for Uint256

* remove and reorder initUintImpl, zero and one procs

* Fix assignation of uint64 to 2xuint32, remove unsafeConv and use const for base/radix

* assign_least_significant_words shouldn't implicitly capture result

* Simplify least significant words macros
2018-06-16 18:54:40 +02:00
Mamy Ratsimbazafy f2d0eab153
Modular arithmetic (#47)
* Add isEven and isOdd functions

* Add modular add, mul, sub pow fixes #18
2018-05-16 10:41:46 +02:00
mratsim 1283d582a1 implement a pow for x, y: UintImpl as well 2018-05-14 19:44:39 +02:00
Mamy Ratsimbazafy 11f62d42c9
Add exponentiation - closes #37 (#46)
* Add exponentiation

* Change name to pow (like ttmath) - `^` to discuss
2018-05-14 19:02:39 +02:00
Yuriy Glukhov ad09fe3a94 Corrected package structure 2018-05-08 17:42:42 +03:00