diff options
Diffstat (limited to 'factors/mtc.go')
| -rw-r--r-- | factors/mtc.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/factors/mtc.go b/factors/mtc.go index 655124c..024391e 100644 --- a/factors/mtc.go +++ b/factors/mtc.go @@ -3,15 +3,15 @@ package factors // MTC returns the multiplication table complexity of a radix n. // This is an estimate of how difficult it is to learn a radix's // multiplication table. -func MTC(n uint64) uint64 { +func MTC(n uint32) uint64 { mtc := uint64(0) - for i := uint64(2); i <= n-2; i++ { - mtc += n / gcd(i, n) + for i := uint32(2); i <= n-2; i++ { + mtc += uint64(n / gcd(i, n)) } return mtc } -func gcd(a, b uint64) uint64 { +func gcd(a, b uint32) uint32 { for b > 0 { a, b = b, a%b } |
