fix power nil pointer

This commit is contained in:
2023-03-08 23:55:36 +00:00
parent 33b3e66ab9
commit cb22278284

View File

@@ -568,6 +568,9 @@ func calcPower(o operationType, stack stack) (number, ArErr) {
n1, _ := output.Float64()
n2, _ := resp.(number).Float64()
output = newNumber().SetFloat64(math.Pow(n1, n2))
if output == nil {
output = infinity
}
} else {
return nil, ArErr{
"Runtime Error",