Types
DynamicBarrettModint[M] = object a: uint32
- Source Edit
StaticBarrettModint[M] = object a: uint32
- Source Edit
Procs
proc `*=`[T: BarrettModint](a: var T; b: T or SomeInteger)
- Source Edit
proc `+=`[T: BarrettModint](a: var T; b: T or SomeInteger)
- Source Edit
proc `-=`[T: BarrettModint](a: var T; b: T or SomeInteger)
- Source Edit
proc `-`[T: BarrettModint](a: T): T
- Source Edit
proc `/=`[T: BarrettModint](a: var T; b: T or SomeInteger)
- Source Edit
proc calc_mul(a, b: culonglong): culonglong {.importcpp: "calc_mul(#, #)", nodecl, inline, ...raises: [], tags: [].}
- Source Edit
func get_param[M: static[uint32]](self: typedesc[DynamicBarrettModint[M]]): ptr [ tuple[M, im: uint]]
- Source Edit
proc init(T: typedesc[BarrettModint]; a: T:type or SomeInteger): auto
- Source Edit
proc inv[T: BarrettModint](x: T): T
- Source Edit
proc rem(T: typedesc[BarrettModint]; a: uint): uint32
- Source Edit
proc setMod[T: static[uint32]](self: typedesc[DynamicBarrettModint[T]]; M: SomeInteger or SomeUnsignedInt)
- Source Edit
proc val(a: BarrettModint): int
- Source Edit
Macros
macro declarDynamicBarrettModint(name, id)
- Source Edit
macro declarStaticBarrettModint(name, M)
- Source Edit
Templates
template `mod`[T: BarrettModint](self: typedesc[T] or T): int32
- Source Edit
template get_M(T: typedesc[BarrettModint]): uint
- Source Edit
template umod[T: BarrettModint](self: typedesc[T] or T): uint32
- Source Edit