stint/intops

Search:
Group by:
Source   Edit  

Procs

func `*`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Signed integer multiplication. Source   Edit  
func `+`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Addition for multi-precision signed int. Source   Edit  
func `+`(a: StInt; b: SomeUnsignedInt): StInt {....raises: [], inline, noinit,
    ...gcsafe.}
Addition for multi-precision signed int with an unsigned integer. Source   Edit  
func `+=`(a: var StInt; b: SomeUnsignedInt) {....raises: [], inline, noinit, ...gcsafe.}
In-place addition for multi-precision signed int with an unsigned integer. Source   Edit  
func `+=`(a: var StInt; b: StInt) {....raises: [], inline, noinit, ...gcsafe.}
In-place addition for multi-precision signed int. Source   Edit  
func `-`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Substraction for multi-precision signed int. Source   Edit  
func `-`(a: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Two complement negation. Source   Edit  
func `-=`(a: var StInt; b: StInt) {....raises: [], inline, noinit, ...gcsafe.}
In-place substraction for multi-precision signed int. Source   Edit  
func `<`(a, b: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Signed int less than comparison. Source   Edit  
func `<=`(a, b: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Signed int less or equal comparison. Source   Edit  
func `==`(a, b: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Signed int equal comparison. Source   Edit  
func abs(a: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Returns the positive value of StInt. Source   Edit  
func `and`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Bitwise and of numbers a and b. Source   Edit  
func clearBit(a: var StInt; k: Natural) {....raises: [], inline, ...gcsafe.}
Set bit at position k: k = 0..a.bits-1. Source   Edit  
func `div`(n, d: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Division operation for multi-precision signed uint. Source   Edit  
func divmod(n, d: StInt): tuple[quot, rem: StInt] {....raises: [], inline, noinit,
    ...gcsafe.}
Division and remainder operations for multi-precision signed uint The sign of the remainder will follow the sign of left operand. Source   Edit  
func getBit(a: StInt; k: Natural): bool {....raises: [], inline, ...gcsafe.}
Set bit at position k: k = 0..a.bits-1. Source   Edit  
func high[bits](_: typedesc[StInt[bits]]): StInt[bits] {....raises: [], inline,
    noinit, ...gcsafe.}
Returns the highest value of StInt. Source   Edit  
func inc(a: var StInt; w: Word = 1) {....raises: [], inline, noinit, ...gcsafe.}
Source   Edit  
func isEven(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Returns true if input is zero, false otherwise. Source   Edit  
func isNegative(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Source   Edit  
func isOdd(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Returns true if input is odd, false otherwise. Source   Edit  
func isOne(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Source   Edit  
func isPositive(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Source   Edit  
func isZero(a: StInt): bool {....raises: [], inline, noinit, ...gcsafe.}
Source   Edit  
func low[bits](_: typedesc[StInt[bits]]): StInt[bits] {....raises: [], inline,
    noinit, ...gcsafe.}
Returns the lowest value of StInt. Source   Edit  
func `mod`(x, y: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Remainder operation for multi-precision signed uint. The behavior is similar to Nim's mod operator. The sign of the remainder will follow the sign of left operand. Source   Edit  
func neg(a: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Two complement negation. Source   Edit  
func negate(a: var StInt) {....raises: [], inline, noinit, ...gcsafe.}
Two complement negation. Source   Edit  
func `not`(a: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Bitwise complement of signed integer a, i.e. flips all bits of the input. Source   Edit  
func one[bits: static[int]](T: typedesc[StInt[bits]]): T:type {....raises: [],
    inline, noinit, ...gcsafe.}
Returns the one of the input type. Source   Edit  
func `or`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Bitwise or of numbers a and b. Source   Edit  
func pow(a: StInt; e: Natural): StInt {....raises: [], noinit, ...gcsafe.}
Compute a to the power of e, e must be non-negative. Source   Edit  
func pow[aBits, eBits](a: StInt[aBits]; e: StInt[eBits]): StInt[aBits] {.
    ...raises: [], noinit, ...gcsafe.}
Compute x to the power of y, x must be non-negative. Source   Edit  
func setBit(a: var StInt; k: Natural) {....raises: [], inline, ...gcsafe.}
Set bit at position k: k = 0..a.bits-1. Source   Edit  
func setOne(a: var StInt) {....raises: [], inline, noinit, ...gcsafe.}
Set a to 1. Source   Edit  
func setZero(a: var StInt) {....raises: [], inline, noinit, ...gcsafe.}
Set a to 0. Source   Edit  
func `shl`(a: StInt; k: SomeInteger): StInt {....raises: [], inline, ...gcsafe.}
Shift left by k bits. Source   Edit  
func `shr`(a: StInt; k: SomeInteger): StInt {....raises: [], inline, ...gcsafe.}
Shift right by k bits, arithmetically value < 0 ? ~(~value >> amount) : value >> amount. Source   Edit  
func sign(a: StInt): int {....raises: [], inline, noinit, ...gcsafe.}
Get the sign of a either -1, 0, or 1. Source   Edit  
func `xor`(a, b: StInt): StInt {....raises: [], inline, noinit, ...gcsafe.}
Bitwise xor of numbers x and y. Source   Edit  
func zero[bits: static[int]](T: typedesc[StInt[bits]]): T:type {....raises: [],
    inline, noinit, ...gcsafe.}
Returns the zero of the input type. Source   Edit