diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-11-01 13:41:29 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-11-01 13:46:19 -0600 |
commit | 7e31e32f093887d5fd99f719a06bc2b5ed7dc9c8 (patch) | |
tree | 697d8eaf11152a3894cac500a9cb8a120a6fde44 /doc | |
parent | 3ab221383bb35fe15b333f75e002afae8cddc931 (diff) | |
download | numpy-7e31e32f093887d5fd99f719a06bc2b5ed7dc9c8.tar.gz |
DOC: Note change to scalar integer powers in 1.12.0 release notes.
[ci skip]
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.12.0-notes.rst | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst index 0baa33049..ffb74f2a4 100644 --- a/doc/release/1.12.0-notes.rst +++ b/doc/release/1.12.0-notes.rst @@ -76,15 +76,29 @@ DeprecationWarning to error ``power`` and ``**`` raise errors for integer to negative integer powers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The previous behavior was +The previous behavior depended on whether numpy scalar integers or numpy +integer arrays were involved. + +For arrays + +* Zero to negative integer powers returned least integral value. +* Both 1, -1 to negative integer powers returned correct values. +* The remaining integers returned zero when raised to negative integer powers. + +For scalars + +* Zero to negative integer powers returned least integral value. +* Both 1, -1 to negative integer powers returned correct values. +* The remaining integers sometimes returned zero, sometimes the + correct float depending on the integer type combination. + +All of these cases now raise a ``ValueError`` except for those integer +combinations whose common type is float, for instance uint64 and int8. It was +felt that a simple rule was the best way to go rather than have special +exceptions for the integer units. If you need negative powers, use an inexact +type. -* zero to negative integer powers returned least integral value. -* 1, -1 to negative integer powers returned correct values -* all remaining integers returned zero when raised to negative integer powers. -All of these cases now raise a ``ValueError``. It was felt that a simple rule -was the best way to go rather than have special exceptions for the units. If -you need negative powers, use an inexact type. Relaxed stride checking is the default ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |