struct Barrett

Defined in:

math/barrett.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(mod) #

Requires 1 <= mod < 2^31


[View source]

Instance Method Detail

def inv : UInt64 #

[View source]
def mod : UInt32 #

[View source]
def mul(a : UInt32, b : UInt32) : UInt32 #

Caluclates a * b % mod.

Requires 0 <= a < mod and 0 <= b < mod


[View source]