Giter VIP home page Giter VIP logo

Comments (3)

01mf02 avatar 01mf02 commented on September 18, 2024

When saying "the paragraph about division by 0", are you talking about the following?

In jaq, n / 0 yields nan if n == 0, infinite if n > 0, and -infinite if n < 0.

I do not see how it is outdated, because I just tried this:

$ jaq -n '0 / 0 | isnan'
true
$ jaq -n '1 / 0 | isinfinite'
true
$ jaq -n '(-1) / 0 | isinfinite'
true

Note also that jq's current (1.6) behavior is dependent on whether the numerator is a literal 0 or a variable equal to 0.

Oh god. Do you have any idea how to describe this behaviour in the README in a concise way?

from jaq.

pkoppstein avatar pkoppstein commented on September 18, 2024

I was referring to the sentence:

"In jq, n / 0 yields nan (not a number) if n == 0 and fails otherwise"

Perhaps it would suffice to write:

Using jq, the behavior of expressions involving division by 0 varies by version.

If you want to describe jq 1.6, you could point out:

In jq 1.6, '(0/0) | isnan' yields true, but other expressions involving division by 0 yield errors.

from jaq.

01mf02 avatar 01mf02 commented on September 18, 2024

Thank you @pkoppstein for pointing out this issue. I tried to document the jq behaviour in d6c3445.

from jaq.

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.