Add atan2 to scalar operators - issue #9485 (#9515)

* Add atan2 to scalar operators

Signed-off-by: Tomasz Ziolkowski <tomasz.ziolkowski@allegro.pl>
This commit is contained in:
ziollek 2021-10-15 16:03:11 +02:00 committed by GitHub
parent fdbc40a9ef
commit 55f9147b44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -2085,6 +2085,8 @@ func scalarBinop(op parser.ItemType, lhs, rhs float64) float64 {
return btos(lhs >= rhs)
case parser.LTE:
return btos(lhs <= rhs)
case parser.ATAN2:
return math.Atan2(lhs, rhs)
}
panic(errors.Errorf("operator %q not allowed for Scalar operations", op))
}

View file

@ -481,3 +481,9 @@ eval instant at 5m trigy atan2 trigx
eval instant at 5m trigy atan2 trigNaN
trigy{} NaN
eval instant at 5m 10 atan2 20
0.4636476090008061
eval instant at 5m 10 atan2 NaN
NaN