struct ModInt(MOD)

Defined in:

math/mint.cr

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(m : ModInt(MOD2)) forall MOD2 #

[View source]
def self.new(value) #

[View source]
def self.new #

[View source]
def self.scan(scanner, io : IO) : self #

[View source]

Class Method Detail

def self.mod #

[View source]
def self.raw(value : Int64) #

[View source]
def self.zero #

[View source]

Instance Method Detail

def *(v) #

[View source]
def *(m : self) #

[View source]
def **(exponent : Int) #

[View source]
def +(m : self) #

[View source]
def +(v) #

[View source]
def + : self #

[View source]
def -(m : self) #

[View source]
def -(v) #

[View source]
def - : self #

[View source]
def /(v) #

[View source]
def /(m : self) #

[View source]
def //(v) #

[View source]
def <(other) #

[View source]
def <=(other) #

[View source]
def ==(m : Int) #

[View source]
def ==(m : ModInt(MOD2)) forall MOD2 #

[View source]
def >(other) #

[View source]
def >=(other) #

[View source]
def abs #

[View source]
def abs2 #

[View source]
def inspect(io : IO) : Nil #
Description copied from struct Struct

Appends this struct's name and instance variables names and values to the given IO.

struct Point
  def initialize(@x : Int32, @y : Int32)
  end
end

p1 = Point.new 1, 2
p1.to_s    # "Point(@x=1, @y=2)"
p1.inspect # "Point(@x=1, @y=2)"

[View source]
def inv #

[View source]
def pred #

[View source]
def succ #

[View source]
def to_i64 : Int64 #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def value : Int64 #

[View source]

Macro Detail

macro [](*nums) #

[View source]