summaryrefslogtreecommitdiff
path: root/doc/release
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-08-17 17:05:30 +0300
committerGitHub <noreply@github.com>2020-08-17 17:05:30 +0300
commitadf50b93d76fa55d03ccbc4910602cda23b32c7d (patch)
tree9e83978cdf6dfa07ab49ee5ec5f34cfcf810e33b /doc/release
parentcec45adb1a6aae140996d78adbe170fb8328c681 (diff)
parentdd2ddde2a22b80ad8fee815276065f417bdd2177 (diff)
downloadnumpy-adf50b93d76fa55d03ccbc4910602cda23b32c7d.tar.gz
Merge pull request #16841 from marload/fix-issue-16813
BUG: linspace should round towards -infinity
Diffstat (limited to 'doc/release')
-rw-r--r--doc/release/upcoming_changes/16841.change.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/16841.change.rst b/doc/release/upcoming_changes/16841.change.rst
new file mode 100644
index 000000000..d9499b6f4
--- /dev/null
+++ b/doc/release/upcoming_changes/16841.change.rst
@@ -0,0 +1,19 @@
+`np.linspace` on integers now use floor
+---------------------------------------
+When using a `int` dtype in `numpy.linspace`, previously float values would
+be rounded towards zero. Now `numpy.floor` is used instead, which rounds toward
+``-inf``. This changes the results for negative values. For example, the
+following would previously give::
+
+ >>> np.linspace(-3, 1, 8, dtype=int)
+ array([-3, -2, -1, -1, 0, 0, 0, 1])
+
+and now results in::
+
+ >>> np.linspace(-3, 1, 8, dtype=int)
+ array([-3, -3, -2, -2, -1, -1, 0, 1])
+
+The former result can still be obtained with::
+
+ >>> np.linspace(-3, 1, 8).astype(int)
+ array([-3, -2, -1, -1, 0, 0, 0, 1])