[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hi round is supposed to provide an integer when called without any precision argument. here is the doc: >>> help(round) round(number[, ndigits]) -> number Round a number to a given precision in decimal digits (default 0 digits). This returns an int when called with one argument, otherwise the same type as the number but in some circumstances it provides a float import numpy as np M = np.array([[0, 9],[2, 7]], dtype=int) np.linalg.det(M) -18.000000000000004 round(np.linalg.det(M)) -18.0 # i was expecting an integer -18, not a float # same problem with np.round np.round(np.linalg.det(M)) -18.0

- Prev by Date:
**Why exception from os.path.exists()?** - Next by Date:
**round** - Previous by thread:
**EuroPython 2018: Training pass sale starts on Friday at 12:00 CEST** - Next by thread:
**round** - Index(es):