diff options
| -rw-r--r-- | factor_info.go | 10 | ||||
| -rw-r--r-- | radix_info.go | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/factor_info.go b/factor_info.go index 62c3524..d2c9fc0 100644 --- a/factor_info.go +++ b/factor_info.go @@ -10,7 +10,7 @@ import ( // FactorInfo contains all of the information this program // calculates about a radix. -type FactorInfo struct { +type factorInfo struct { // The radix this info is about Radix uint // A representation of this radix as a product of prime numbers. @@ -58,7 +58,7 @@ const ( maxExtended = 1 << 32 ) -func GetFactorInfo(radix uint, fullMap bool, largeCalc bool) *FactorInfo { +func getFactorInfo(radix uint, fullMap bool, largeCalc bool) *factorInfo { r_factors := factors.Factors(radix) slices.Sort(r_factors) @@ -89,13 +89,13 @@ func GetFactorInfo(radix uint, fullMap bool, largeCalc bool) *FactorInfo { totativeCount := factors.Totient(radix) totativeRatio := float64(totativeCount) / float64(radix) - return &FactorInfo{radix, factors.PrimeFactorize(radix), + return &factorInfo{radix, factors.PrimeFactorize(radix), r_factors, factors.Score(radix), totativeCount, totativeRatio, factors.BasicRank(radix), r_type_ptr, mtc_ptr, math.Log(float64(radix)), digitMap} } -func (fi *FactorInfo) WriteTo(w io.Writer) { +func (fi *factorInfo) writeTo(w io.Writer) { fmt.Fprintln(w, fi.Radix, "=", fi.PrimeFactorization) fmt.Fprintf(w, "Factors: %v (Score: %.4f)\n", fi.Factors, fi.Score) fmt.Fprintln(w, "2345 Rank:", fi.BasicRank) @@ -119,7 +119,7 @@ func (fi *FactorInfo) WriteTo(w io.Writer) { } } -func (fi *FactorInfo) WriteToCompact(w io.Writer) { +func (fi *factorInfo) writeToCompact(w io.Writer) { fmt.Fprintf(w, "%d = %s | σ(n)/n: %.2f | φ(n)/n: %.3f\n", fi.Radix, fi.PrimeFactorization, fi.Score, fi.TotativeRatio) if fi.Type != nil { diff --git a/radix_info.go b/radix_info.go index 79b68e0..afcc5b2 100644 --- a/radix_info.go +++ b/radix_info.go @@ -12,11 +12,11 @@ func main() { } if err == nil { - factorInfo := GetFactorInfo(args.Radix, args.FullMap, args.LargeCalc) + factorInfo := getFactorInfo(args.Radix, args.FullMap, args.LargeCalc) if args.Compact { - factorInfo.WriteToCompact(os.Stdout) + factorInfo.writeToCompact(os.Stdout) } else { - factorInfo.WriteTo(os.Stdout) + factorInfo.writeTo(os.Stdout) } } else { fmt.Fprintln(os.Stderr, err) |
