Anonymous user
Montgomery reduction: Difference between revisions
m
→{{header|Tcl}}: fix broken highlighting
(→Tcl: Added implementation (output to come once worked out how to demonstrate…)) |
m (→{{header|Tcl}}: fix broken highlighting) |
||
Line 248:
<lang tcl>package require Tcl 8.5
proc montgomeryReduction {m
set A $T
for {set i 0} {$i < $n} {incr i} {
Line 255:
set a [expr {$a / $b}]
}
set ui [expr {($a % $b) * $
incr A [expr {$ui * $m * $b**$i}]
}
|