Chinese remainder theorem: Difference between revisions

m (Automated syntax highlighting fixup (second round - minor fixes))
Line 768:
=={{header|EasyLang}}==
{{trans|C}}
<syntaxhighlight lang="text">func mul_inv a b . x1 .
func mul_inv a b . x1 .
b0 = b
x1 = 1
Line 789 ⟶ 790:
prod = 1
sum = 0
for i range= 1 to len n[]
prod *= n[i]
.
for i range= 1 to len n[]
p = prod / n[i]
call mul_inv p n[i] h
Line 802 ⟶ 803:
a[] = [ 2 3 2 ]
call remainder n[] a[] h
print h</syntaxhighlight>
</syntaxhighlight>
{{out}}
<pre>23</pre>
 
=={{header|EchoLisp}}==
'''egcd''' - extended gcd - and '''crt-solve''' - chinese remainder theorem solve - are included in math.lib.
2,022

edits