2018-04-25 19:21:25 +00:00
|
|
|
# Stint
|
2018-03-02 10:48:08 +00:00
|
|
|
# Copyright 2018 Status Research & Development GmbH
|
|
|
|
# Licensed under either of
|
|
|
|
#
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
|
|
#
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
2018-02-15 14:01:08 +00:00
|
|
|
|
2020-06-12 21:53:08 +00:00
|
|
|
# import stint/[bitops2, endians2, intops, io, modular_arithmetic, literals_stint]
|
|
|
|
# export bitops2, endians2, intops, io, modular_arithmetic, literals_stint
|
|
|
|
|
|
|
|
import stint/[io, uintops, bitops2]
|
|
|
|
export io, uintops, bitops2
|
2018-05-06 20:41:49 +00:00
|
|
|
|
|
|
|
type
|
2020-06-12 21:53:08 +00:00
|
|
|
# Int128* = Stint[128]
|
|
|
|
# Int256* = Stint[256]
|
2018-05-06 20:41:49 +00:00
|
|
|
UInt128* = StUint[128]
|
|
|
|
UInt256* = StUint[256]
|
|
|
|
|
2018-11-07 15:18:25 +00:00
|
|
|
func u128*(n: SomeInteger): UInt128 {.inline.} = n.stuint(128)
|
|
|
|
func u128*(s: string): UInt128 {.inline.} = s.parse(UInt128)
|
2018-05-06 20:41:49 +00:00
|
|
|
|
2018-11-07 15:18:25 +00:00
|
|
|
func u256*(n: SomeInteger): UInt256 {.inline.} = n.stuint(256)
|
|
|
|
func u256*(s: string): UInt256 {.inline.} = s.parse(UInt256)
|
2018-05-06 20:41:49 +00:00
|
|
|
|
2020-06-12 21:53:08 +00:00
|
|
|
# func i128*(n: SomeInteger): Int128 {.inline.} = n.stint(128)
|
|
|
|
# func i128*(s: string): Int128 {.inline.} = s.parse(Int128)
|
2018-05-06 20:41:49 +00:00
|
|
|
|
2020-06-12 21:53:08 +00:00
|
|
|
# func i256*(n: SomeInteger): Int256 {.inline.} = n.stint(256)
|
|
|
|
# func i256*(s: string): Int256 {.inline.} = s.parse(Int256)
|