summaryrefslogtreecommitdiff
path: root/factors/type.go
diff options
context:
space:
mode:
Diffstat (limited to 'factors/type.go')
-rw-r--r--factors/type.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/factors/type.go b/factors/type.go
index 33c48bd..91eb94e 100644
--- a/factors/type.go
+++ b/factors/type.go
@@ -41,7 +41,10 @@ var superabundantNums = [...]uint64{
6133685312708553600, 9200527969062830400, 18401055938125660800,
}
-// A type of number (as determined by its factors)
+// A classification of numbers, based on how many factors they have.
+// Each type is a subset of the next (except [Practical] and [NotPractical]),
+// so a number is only counted as its most exclusive type.
+// The zero value of this type is invalid.
type NumberType byte
const (
@@ -64,6 +67,7 @@ const (
NotPractical NumberType = 0x40
)
+// Type determines the [NumberType] of a number.
func Type(n uint) NumberType {
if slices.Contains(colossallyAbundantNums[:], uint64(n)) {
return ColossallyAbundant