Mathematics of MOS: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 85: | Line 85: | ||
== Algorithms == | == Algorithms == | ||
Below is some Maple code for various mathematical routines having to do with MOS. If you have access to Maple, you can of course copy and run these programs. Even if you do not, Maple code makes better pseudocode than most languages or computer algebra packages afford, so it can be used as pseudocode. For that purpose, it will be helpful to know that <code>modp(x, n)</code> means reducing ''x'' mod the integer ''n'' to 0, 1, …, {{nowrap|''n'' − 1}} not only when ''x'' is an integer, but also when it is a rational number with denominator prime to ''n''. In that case, {{nowrap|{{frac|''p''|''q''}} (mod ''n'') {{=}} ''r''}} means {{nowrap|''p'' {{=}} ''qr'' (mod ''n'')}}. | Below is some {{w|maple (software)|Maple}} code for various mathematical routines having to do with MOS. If you have access to Maple, you can of course copy and run these programs. Even if you do not, Maple code makes better pseudocode than most languages or computer algebra packages afford, so it can be used as pseudocode. For that purpose, it will be helpful to know that <code>modp(x, n)</code> means reducing ''x'' mod the integer ''n'' to 0, 1, …, {{nowrap|''n'' − 1}} not only when ''x'' is an integer, but also when it is a rational number with denominator prime to ''n''. In that case, {{nowrap|{{frac|''p''|''q''}} (mod ''n'') {{=}} ''r''}} means {{nowrap|''p'' {{=}} ''qr'' (mod ''n'')}}. | ||
Note that some procedures below depend on others. Special procedure names (i.e. not built into Maple) are shown in <code>'''bold type'''</code>. | Note that some procedures below depend on others. Special procedure names (i.e. not built into Maple) are shown in <code>'''bold type'''</code>. |