SciRuby/nmatrix

Proposed spec change: Integer should be treated as :object dtype rather than :int64

translunar opened this issue · 1 comments

This issue follows from #604 (comment).

In the past, guess_dtype() would take a Fixnum and auto-assign a dtype of :int64. Now that Fixnum and Bignum are deprecated, an Integer may contain values that won't fit in :int64. Before we can release a new version, we need to adjust Integer to default to :object instead.

The other option (bad) would be to check each and every item in an array for :int64 overflow before allocating.

This raises the following question: do we even still want the :int64 dtype, or is it better to just use :object for anything that looks like an integer?

I'm just revisiting this issue to note that using :object for integers will (a) speed up compilation, and (b) possibly make it easier for us to support faster element-wise math for float32, float64, and the complex dtypes.