operator-sum.go: Fixed sum of fraction and float
This commit is contained in:
parent
3a30d890c6
commit
6ef468408c
@ -56,7 +56,11 @@ func evalPlus(ctx ExprContext, self *term) (v any, err error) {
|
|||||||
}
|
}
|
||||||
v = &sumList
|
v = &sumList
|
||||||
} else if isFraction(leftValue) || isFraction(rightValue) {
|
} else if isFraction(leftValue) || isFraction(rightValue) {
|
||||||
v, err = sumAnyFract(leftValue, rightValue)
|
if isFloat(leftValue) || isFloat(rightValue) {
|
||||||
|
v = numAsFloat(leftValue) + numAsFloat(rightValue)
|
||||||
|
} else {
|
||||||
|
v, err = sumAnyFract(leftValue, rightValue)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = self.errIncompatibleTypes(leftValue, rightValue)
|
err = self.errIncompatibleTypes(leftValue, rightValue)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user