[Matrix-SIG] Numeric Nits

Rick White rlw@stsci.edu
Wed, 23 Jun 1999 15:30:12 -0400 (EDT)


Scott Ransom wrote:

>The more I think about it, maybe Konrad et al. are correct with the
>solution of declaring certain 'f' arrays higher in the cast hierarchy
>than doubles.  These arrays would never be up-cast to type double.  This
>would allow the use of the same simple syntax (i.e. arange(3.0, typecode
>= 'f') * 2.0  gives array([ 0.,  2.,  4.],'f') _not_ array([ 0.,  2., 
>4.]).
>
>The user would still have to be careful about sending the 'f' arrays to
>functions that expect double arrays, but we have to do that now
>anyways.  So I don't see that as a major problem.

I also agree that this is probably the best solution.  Presumably this
would be applied to all the types, so that there would be special
non-promoting versions of bytes, shorts, etc. too.

The only drawback I see to this approach is that the proliferation of
types will make Numeric C code messier.  If that is acceptable, though,
this looks like it should satisfy everyone.