Re: [Numpy-discussion] round / set_printoptions discrepancy

Sept. 13, 2019
11:59 a.m.
In my opinion the problem is that numpy floats break the Liskov substitution principle,
Since numpy.float64 is a subclass of builtins.float I would expect that
round(x, j) == round(np.float64(x), j)
is an invariant, but unfortunately this is not the case. Moreover the python3 semantics of the round function require that when the number of digits is None, the return value should be of integral type:
see also https://github.com/numpy/numpy/issues/11810 Stefano
2009
Age (days ago)
2009
Last active (days ago)
0 comments
1 participants
participants (1)
-
Stefano Miccoli