2018-05-08 13:51:55 +00:00
|
|
|
import ../stint, ttmath
|
2018-05-03 18:10:55 +00:00
|
|
|
export ttmath
|
|
|
|
|
|
|
|
template asSt*(val: UInt): auto =
|
|
|
|
type TargetType = StUint[val.NumBits]
|
|
|
|
cast[ptr TargetType](unsafeAddr val)[]
|
|
|
|
|
|
|
|
template asSt*(val: Int): auto =
|
|
|
|
type TargetType = StInt[val.NumBits]
|
|
|
|
cast[ptr TargetType](unsafeAddr val)[]
|
|
|
|
|
|
|
|
template asTT*[N: static[int]](arr: array[N, uint]): auto =
|
|
|
|
type TargetType = UInt[N * 64]
|
|
|
|
cast[ptr TargetType](unsafeAddr arr[0])[]
|
|
|
|
|
|
|
|
template asTT*[N: static[int]](arr: array[N, int]): auto =
|
|
|
|
type TargetType = Int[N * 64]
|
|
|
|
cast[ptr TargetType](unsafeAddr arr[0])[]
|
|
|
|
|