Skip to content

Fix code and unit test for a few corner cases in vectorized pow()

Due to a bad test, a few corner cases were not handled correctly by the vectorized implementation of pow(). Specifically, the following two specifications would not be satisfied:

  1. pow(-∞, exp) returns -∞ if exp is a positive odd integer.
  2. pow(-0, exp), where exp is a negative odd integer, returns -∞.

Instead, the erroneous code returned +∞ in these cases.

Thanks to @chuckyschluz for reporting this.

Edited by Rasmus Munk Larsen

Merge request reports

Loading