summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorczgdp1807 <gdp.1807@gmail.com>2021-09-03 12:17:26 +0530
committerczgdp1807 <gdp.1807@gmail.com>2021-09-03 12:17:26 +0530
commit781d0a7ac61ce007e65abcd4e30f2181e729ae61 (patch)
treef45f38a246bcefbca9ca8a08bd8ba55cbc6cdb15 /numpy/core/fromnumeric.py
parentb341e4c3249817d2e14ddf71aa850a8a896b9303 (diff)
parent2ae1e068710174dc57b5ba5ad688517608efcf26 (diff)
downloadnumpy-781d0a7ac61ce007e65abcd4e30f2181e729ae61.tar.gz
resolved conflicts
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 764377bc9..5ecb1e666 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -3320,18 +3320,15 @@ def around(a, decimals=0, out=None):
----------
.. [1] "Lecture Notes on the Status of IEEE 754", William Kahan,
https://people.eecs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF
- .. [2] "How Futile are Mindless Assessments of
- Roundoff in Floating-Point Computation?", William Kahan,
- https://people.eecs.berkeley.edu/~wkahan/Mindless.pdf
Examples
--------
>>> np.around([0.37, 1.64])
- array([0., 2.])
+ array([0., 2.])
>>> np.around([0.37, 1.64], decimals=1)
- array([0.4, 1.6])
+ array([0.4, 1.6])
>>> np.around([.5, 1.5, 2.5, 3.5, 4.5]) # rounds to nearest even value
- array([0., 2., 2., 4., 4.])
+ array([0., 2., 2., 4., 4.])
>>> np.around([1,2,3,11], decimals=1) # ndarray of ints is returned
array([ 1, 2, 3, 11])
>>> np.around([1,2,3,11], decimals=-1)