diff --git a/postgres/numeric.go b/postgres/numeric.go index 6f89f81..bcec717 100644 --- a/postgres/numeric.go +++ b/postgres/numeric.go @@ -54,13 +54,13 @@ func (n Numeric) MatchExp(exp int32) Numeric { }} } -func (n Numeric) Sub(o Numeric) Numeric { +func (n Numeric) Sub(other Numeric) Numeric { left := n - right := o - if n.Exp < o.Exp { - right = o.MatchExp(n.Exp) - } else if n.Exp > o.Exp { - left = n.MatchExp(o.Exp) + right := other + if n.Exp < other.Exp { + right = other.MatchExp(n.Exp) + } else if n.Exp > other.Exp { + left = n.MatchExp(other.Exp) } if left.Exp == right.Exp { @@ -73,13 +73,13 @@ func (n Numeric) Sub(o Numeric) Numeric { panic("Cannot subtract with different exponents") } -func (n Numeric) Add(o Numeric) Numeric { +func (n Numeric) Add(other Numeric) Numeric { left := n - right := o - if n.Exp < o.Exp { - right = o.MatchExp(n.Exp) - } else if n.Exp > o.Exp { - left = n.MatchExp(o.Exp) + right := other + if n.Exp < other.Exp { + right = other.MatchExp(n.Exp) + } else if n.Exp > other.Exp { + left = n.MatchExp(other.Exp) } if left.Exp == right.Exp {