Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Modular-arithmetic/Jq/modular-arithmetic-3.jq
Normal file
26
Task/Modular-arithmetic/Jq/modular-arithmetic-3.jq
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
def ring::add($A; $B):
|
||||
if $A|is_modint then modint::add($A; $B)
|
||||
elif $A|is_integer then $A + $B
|
||||
else "ring::add" | error
|
||||
end;
|
||||
|
||||
def ring::mul($A; $B):
|
||||
if $A|is_modint then modint::mul($A; $B)
|
||||
elif $A|is_integer then $A * $B
|
||||
else "ring::mul" | error
|
||||
end;
|
||||
|
||||
def ring::pow($A; $B):
|
||||
if $A|is_modint then modint::pow($A; $B)
|
||||
elif $A|is_integer then $A|power($B)
|
||||
else "ring::pow" | error
|
||||
end;
|
||||
|
||||
def ring::pp:
|
||||
if is_modint then modint::pp
|
||||
elif is_integer then .
|
||||
else "ring::pp" | error
|
||||
end;
|
||||
|
||||
def ring::f($x):
|
||||
ring::add( ring::add( ring::pow($x; 100); $x); 1);
|
||||
Loading…
Add table
Add a link
Reference in a new issue