ruby-numo / numo-narray

Ruby/Numo::NArray - New NArray class library
http://ruby-numo.github.io/narray/
BSD 3-Clause "New" or "Revised" License
413 stars 41 forks source link

'sum' method for Numo::RObject returns wrong value #169

Open himotoyoshi opened 4 years ago

himotoyoshi commented 4 years ago

The "sum" method of "Numo::RObject", which contains the number, returns a strange value.

require "numo/narray"

p Numo::RObject.cast([1, 2, 3]).sum
#=> 13 (should be 6)

p Numo::RObject.cast([1.0, 2.0, 3.0]).sum
#=> 54043195528445954 (should be 6.0)

Is this behavior only occurring in my environment,

kojix2 commented 4 years ago

Hi It happens in my environment, too.