Commit Graph

6 Commits

Author SHA1 Message Date
andri lim ccf87daac1 implement arithmetic right shift (#76)
* implement arithmetic right shift

* workaround Nim VM 'cast' limitation

* fix high(stint) bug

* fix compile time bit shift bug

* add test for compile time shift and high(stint)

* add tests against ttmath
2019-05-11 15:44:41 +02: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
Mamy Ratsimbazafy 36ec850c4f
Compile time signed ints (#55)
* Refactor asSignedWords, kill 130+ lines

* Allow signed int initialization at compiletime.

* inline procs in uint_mul

* Fix an unfortunate shadowing in high(Int)
2018-06-18 16:44:29 +02:00
Mamy Ratsimbazafy 8e25b30209
fix highest signed int comment 2018-05-17 09:45:42 +02:00
Mamy Ratsimbazafy c588a84f19
wrong variable net only_msb_set to only_msb_unset in high(IntImpl) 2018-05-17 09:43:41 +02:00
Yuriy Glukhov ad09fe3a94 Corrected package structure 2018-05-08 17:42:42 +03:00