[Matrix-SIG] Numeric Nits

Scott M. Ransom ransom@cfa.harvard.edu
Wed, 23 Jun 1999 15:16:18 -0400


Tim Hochberg wrote:
> 
> I'm curious, what other casting rules you would like to change? I'm one of
> the people who rarely uses arrays of type 'f', so I don't have deep insight
> into what "you people" want....

Upcasting is fine most of the time -- as you know it is the "right"
thing to do in order to not lose accuracy in many circumstances.

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.

Scott


-- 
Scott M. Ransom                   Address:  Harvard-Smithsonian CfA
Phone:  (617) 496-2526                      60 Garden St.  MS 10 
email:  ransom@cfa.harvard.edu              Cambridge, MA  02138
PGP Fingerprint: D2 0E D0 10 CD 95 06 DA  EF 78 FE 2B CB 3A D3 53