Skip to content

Commit

Permalink
fix: [nan pow] if left is nan, pow() return nan
Browse files Browse the repository at this point in the history
  • Loading branch information
jiekun committed Nov 4, 2024
1 parent 363400d commit ddccb09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions binaryop/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func Mod(left, right float64) float64 {

// Pow returns pow(left, right)
func Pow(left, right float64) float64 {
if math.IsNaN(left) {
return nan
}
return math.Pow(left, right)
}

Expand Down

0 comments on commit ddccb09

Please sign in to comment.