summaryrefslogtreecommitdiff
path: root/doc/release
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-08-03 16:08:14 -0700
committerRoss Barnowski <rossbar@berkeley.edu>2020-08-03 16:08:14 -0700
commit1f2aef37cbaf83749699af6e80a33bd02b74b729 (patch)
treec744fff14d95717beffbcd849ee416c9173099b8 /doc/release
parent8e914cf7f1c6433c8f7f76eccdb67375fece4126 (diff)
downloadnumpy-1f2aef37cbaf83749699af6e80a33bd02b74b729.tar.gz
DOC: Add example to release note
Diffstat (limited to 'doc/release')
-rw-r--r--doc/release/upcoming_changes/16841.change.rst16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/release/upcoming_changes/16841.change.rst b/doc/release/upcoming_changes/16841.change.rst
index 9f112fd52..d9499b6f4 100644
--- a/doc/release/upcoming_changes/16841.change.rst
+++ b/doc/release/upcoming_changes/16841.change.rst
@@ -2,4 +2,18 @@
---------------------------------------
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.
+``-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])