On Wed, Oct 26, 2016 at 1:39 PM, Nathaniel Smith <n...@pobox.com> wrote:
> On Wed, Oct 26, 2016 at 12:23 PM, Charles R Harris > <charlesr.har...@gmail.com> wrote: > [...] > > What I have been concerned about are the follow combinations that > currently > > return floats > > > > num: <type 'numpy.int8'>, exp: <type 'numpy.int8'>, res: <type > > 'numpy.float32'> > > num: <type 'numpy.int16'>, exp: <type 'numpy.int8'>, res: <type > > 'numpy.float32'> > > num: <type 'numpy.int16'>, exp: <type 'numpy.int16'>, res: <type > > 'numpy.float32'> > > num: <type 'numpy.int32'>, exp: <type 'numpy.int8'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int32'>, exp: <type 'numpy.int16'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int32'>, exp: <type 'numpy.int32'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int64'>, exp: <type 'numpy.int8'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int64'>, exp: <type 'numpy.int16'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int64'>, exp: <type 'numpy.int32'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int64'>, exp: <type 'numpy.int64'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.int64'>, exp: <type 'numpy.int64'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.uint64'>, exp: <type 'numpy.int8'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.uint64'>, exp: <type 'numpy.int16'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.uint64'>, exp: <type 'numpy.int32'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.uint64'>, exp: <type 'numpy.int64'>, res: <type > > 'numpy.float64'> > > num: <type 'numpy.uint64'>, exp: <type 'numpy.int64'>, res: <type > > 'numpy.float64'> > > What's this referring to? For both arrays and scalars I get: > > In [8]: (np.array(2, dtype=np.int8) ** np.array(2, dtype=np.int8)).dtype > Out[8]: dtype('int8') > > In [9]: (np.int8(2) ** np.int8(2)).dtype > Out[9]: dtype('int8') > > You need a negative exponent to see the effect. Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion