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

The behavior of `Numo::Bit#to_string` is not consistent. #187

Open kojix2 opened 3 years ago

kojix2 commented 3 years ago

Hello.

I found some strange behavior of Numo::Bit. Is this some kind of bug?

Step to reproduce

Create a Numo::Bit object.

b = Numo::Bit.ones(1,2)

Call to_string. The results are inconsistent. If you run irb again, you will get a different result.

b.to_string

# "W" or
# "#" or
# "\x87" ... etc
kojix2 commented 3 years ago

I understood it somehow. Maybe this is not a bug. We need at least 8 bits to call to_string.