Chinese remainder theorem: Difference between revisions
→{{header|EasyLang}}
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
|||
Line 768:
=={{header|EasyLang}}==
{{trans|C}}
<syntaxhighlight lang="text">
func mul_inv a b . x1 .
b0 = b
x1 = 1
Line 789 ⟶ 790:
prod = 1
sum = 0
for i
prod *= n[i]
.
for i
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>
{{out}}
<pre>23</pre>
=={{header|EchoLisp}}==
'''egcd''' - extended gcd - and '''crt-solve''' - chinese remainder theorem solve - are included in math.lib.
|