Giter Club home page Giter Club logo

Comments (4)

masa16 avatar masa16 commented on July 25, 2024

The current release version of NArray does not support error/warning handling in the course of calculation, because it requires an amount of new design and development. How do we switch behaviours? Where is the error information recorded? How do we treat partially calculated array? The future version of NArray may support such features.

from narray.

maasha avatar maasha commented on July 25, 2024

I am struggling with this issue again (I think):

irb(main):001:0> require 'narray'
=> true
irb(main):002:0> (NArray.int(300).indgen! > 0).sum
=> 43

Please explain to me why this is not returning 299 as expected?

PS

If I am indeed overflowing some 256 char value, I would expect that it could be fixed by converting to an integer array:

irb(main):003:0> (NArray.int(300).indgen! > 0).to_i.sum
=> 43

alas, same wrong result. It seems that byte NArray cannot be converted to int NArray? (no warning no nothing):

irb(main):005:0> NArray.byte(10).to_i
=> NArray.byte(10):
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
irb(main):006:0> NArray.float(10).to_i
=> NArray.int(10):
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]

PPS

There are probably a number of different ways to solve the problem like:

irb(main):004:0> (NArray.int(300).indgen!.where > 0).size
=> 299

But I feel that this is actually arriving at the result indirectly.

from narray.

masa16 avatar masa16 commented on July 25, 2024
irb(main):002:0> (NArray.int(300).indgen! > 0).count_true
=> 299

from narray.

maasha avatar maasha commented on July 25, 2024

Neat, however, I am still puzzled about NArray's behaviour in the above circumstances.

from narray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.