Modular arithmetic: Difference between revisions

Content added Content deleted
(Adding the Forth solution)
No edit summary
Line 557: Line 557:
MI{ 3 7 } 50 ^ = MI{ 2 7 }
MI{ 3 7 } 50 ^ = MI{ 2 7 }
</pre>
</pre>
=={{header|Forth}}
=={{header|Forth}}==
<pre>
\ We would normally define operators that have a suffix `m' in order
\ We would normally define operators that have a suffix `m' in order
\ not be confused: +m -m *m /m **m
\ not be confused: +m -m *m /m **m
Line 607: Line 608:
10 DUP 100 ** + 1 + . CR
10 DUP 100 ** + 1 + . CR


</pre>

=={{header|Go}}==
=={{header|Go}}==
Go does not allow redefinition of operators. That element of the task cannot be done in Go. The element of defining f so that it can be used with any ring however can be done, just not with the syntactic sugar of operator redefinition.
Go does not allow redefinition of operators. That element of the task cannot be done in Go. The element of defining f so that it can be used with any ring however can be done, just not with the syntactic sugar of operator redefinition.