Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Modular-arithmetic/Sidef/modular-arithmetic.sidef
Normal file
17
Task/Modular-arithmetic/Sidef/modular-arithmetic.sidef
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class Modulo(n=0, m=13) {
|
||||
|
||||
method init {
|
||||
(n, m) = (n % m, m)
|
||||
}
|
||||
|
||||
method to_n { n }
|
||||
|
||||
< + - * ** >.each { |meth|
|
||||
Modulo.def_method(meth, method(n2) { Modulo(n.(meth)(n2.to_n), m) })
|
||||
}
|
||||
|
||||
method to_s { "#{n} 「mod #{m}」" }
|
||||
}
|
||||
|
||||
func f(x) { x**100 + x + 1 }
|
||||
say f(Modulo(10, 13))
|
||||
Loading…
Add table
Add a link
Reference in a new issue