[Numpy-discussion] PEP 209: Multi-dimensional Arrays

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed Feb 14 13:09:59 EST 2001


> Being a scientist, I have learned that when you multiply a very accurate
> number with a very approximate number, your result is going to be very
> approximate, not very accurate! It would thus be more logical to have
> Float32*Float64 return a Float32!

Accuracy is not the right concept, but storage capacity. A Float64 can
store any value that can be stored in a Float32, but the inverse is
not true. Accuracy is not a property of a number, but of a value
and its representation in the computer. The float value "1." can
be perfectly accurate, even in 32 bits, or it can be an approximation
for 1.-1.e-50, which cannot be represented precisely.

BTW, Float64 also has a larger range of magnitudes than Float32,
not just more significant digits.

> Numeric 2 should be as compatible as reasonably possible with core python.
> But my question is: how would we do integer division of arrays? A ufunc
> for which no operator shortcut exists?

Sounds fine. On the other hand, if and when Python's integer division
behaviour is changed, there will be some new syntax for integer division,
which should then also work on arrays.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list