summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-24 00:39:15 +0300
committerPaul Buetow <paul@buetow.org>2026-05-24 00:39:15 +0300
commit78e57d37bdaa787372a1e21647057428aa4ad90b (patch)
treed1b62b589cac4204f460fe39ce6ab59da49d43f7
parentf4aed5eca8148fd2064ebd5f873fff87e14a6706 (diff)
docs(rpn): fix Rat.Compare comment to cover all NumericValue types
The comment said 'For Rat-to-Float comparison' but the method accepts NumericValue, not just Float. Changed to 'comparison with non-Rat types' to accurately describe the interface contract.
-rw-r--r--internal/rpn/number.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/rpn/number.go b/internal/rpn/number.go
index 562ef77..47674d8 100644
--- a/internal/rpn/number.go
+++ b/internal/rpn/number.go
@@ -315,7 +315,7 @@ func (r *Rat) SetMetric(m *Metric) NumericValue {
// Compare returns -1, 0, or 1 if this rational is less than, equal to, or greater than another.
// For Rat-to-Rat comparison, uses direct big.Rat.Cmp() for exact precision.
-// For Rat-to-Float comparison, converts via float64 (acceptable precision loss).
+// For comparison with non-Rat types, converts via float64 (acceptable precision loss).
func (r *Rat) Compare(other NumericValue) (int, error) {
// Rat-to-Rat: direct comparison with full precision
if otherRat, ok := other.(*Rat); ok {