From af9680f0ed8d9282a70d5b4099445133d7c69af5 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Wed, 30 Aug 2023 20:52:46 -0500 Subject: Raise precision in non-compact display The non-compact display is intended as a "full info" display, so it makes sense to have more precision in these numbers. The compact display is unchanged. --- factor_info.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/factor_info.go b/factor_info.go index a6b91a9..ce014ed 100644 --- a/factor_info.go +++ b/factor_info.go @@ -77,8 +77,8 @@ func GetFactorInfo(radix uint) *FactorInfo { func (fi *FactorInfo) WriteTo(w io.Writer) { fmt.Fprintln(w, fi.Radix, "=", fi.PrimeFactorization) - fmt.Fprintf(w, "Factors: %v (Score: %.2f)\n", fi.Factors, fi.Score) - fmt.Fprintf(w, "Totative Ratio: %.1f%%\n", fi.TotativeRatio * 100.0) + fmt.Fprintf(w, "Factors: %v (Score: %.4f)\n", fi.Factors, fi.Score) + fmt.Fprintf(w, "Totative Ratio: %.3f%%\n", fi.TotativeRatio * 100.0) fmt.Fprintln(w, "2345 Rank:", fi.BasicRank) if fi.Type != nil { writeTypeMessage(w, *fi.Type) @@ -89,7 +89,7 @@ func (fi *FactorInfo) WriteTo(w io.Writer) { fmt.Fprintf(w, "Multiplication Table Complexity ≤ %.4g\n", float32(fi.Radix)*float32(fi.Radix-2)) } - fmt.Fprintf(w, "Natural Logarithm: %.2f\n", fi.Ln) + fmt.Fprintf(w, "Natural Logarithm: %.3f\n", fi.Ln) if len(fi.DigitMap) > 0 { writeDigitMap(w, fi.DigitMap) } -- cgit v1.2.3