On Mon, Apr 28, 2014 at 10:36 AM, Neal Becker <ndbeck...@gmail.com> wrote:

> I notice rint returns float.  Shouldn't it return int?
>

AFAICT, rint() is the same as round(), except with slightly different rules
for the "halfway" case. So returning a float makes sense, as round() and
ceil() and floor() all do.

( though I've always thought those should return inegers, too... )

By the way, what IS the difference between rint and round?

In [37]: for val in [-2.5, -3.5, 2.5, 3.5]:
   ....:     assert np.rint(val) == np.round(val)
   ....:

In [38]:

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.go <chris.bar...@noaa.gov>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to