Code Monkey home page Code Monkey logo

Comments (3)

humpity avatar humpity commented on August 16, 2024

But nanV is not 0. So it can't be false.

from basic.

olimaticer avatar olimaticer commented on August 16, 2024

"But nanV is not 0" that is right.
But the comparison with NaN has to be false by definition.
See the examples below.

Comparison with NaN
A comparison with a NaN always returns an unordered result even when comparing with itself. The
comparison predicates are either signaling or non-signaling on quiet NaN operands; the signaling
versions signal the invalid operation exception for such comparisons. The equality and inequality
predicates are non-signaling so x = x returning false can be used to test if x is a quiet NaN. The other
standard comparison predicates are all signaling if they receive a NaN operand, the standard also
provides non-signaling versions of these other predicates. The predicate isNaN(x) determines if a value
is a NaN and never signals an exception, even if x is a signaling NaN.
Comparison between NaN and any floating-point value x (including NaN and ±∞)
Comparison NaN ≥ x NaN ≤ x NaN > x NaN < x NaN = x NaN ≠ x
Result Always False Always False Always False Always False Always False Always True
See also
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_intro.html#110

But nanV is not 0. So it can't be false.

Thank you very much!
Yes, I have to extend the loop commands.
IF nanV then ?"true" else ?"false"
works like a charm now.

IF nanV = nanV then ?"true" else ?"false"
and
IF nanV = !nanV then ?"true" else ?"false"
returns false as expected, but
IF !nanV = nanV then ?"true" else ?"false"
returns true. So sad!
Any ideas?

from basic.

olimaticer avatar olimaticer commented on August 16, 2024

OK, found a solution now.

from basic.

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.