diff options
Diffstat (limited to 'radix_info.go')
| -rw-r--r-- | radix_info.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/radix_info.go b/radix_info.go index 3e83aad..a107b73 100644 --- a/radix_info.go +++ b/radix_info.go @@ -4,7 +4,7 @@ import ( "aphopkins/radix_info/factors" "fmt" "os" - "sort" + "slices" "strconv" ) @@ -15,9 +15,7 @@ func main() { n := uint(n) fmt.Printf("%d = %s\n", n, factors.PrimeFactorize(n)) n_factors := factors.Factors(n) - sort.Slice(n_factors, func(i, j int) bool { - return n_factors[i] < n_factors[j] - }) + slices.Sort(n_factors) factorScore := factors.Score(n) fmt.Printf("Factors: %v (Score: %.2f)\n", n_factors, factorScore) fmt.Printf("Totative Ratio: %03.1f%%\n", |
