Comparing NaN constant (s) with buggy results!

Hey people NI Forum!

I know that I should be very careful when comparisons on point numbers because of rounding and representation issues.

That said, I completely took off guard when I wanted a Boolean "true" If a number is NOT equal to "NaN"... I wasn't thinking too, slinging just wire a conditional fast for Terminal loop for a few tests, I was doing a temporary VI and put in place with a primitive "does not correspond to" (instead of the "Not a number/path/refnum" primitives.)

The result took me by surprise, and when I dug into it, it became even more strange... it turns out that comparing a single constant itself will produce unexpected results too!

Is this how it has always been, or what ' s NEW in LV 2015?

I've included a LV 2011 version if someone wants to try on an old version... I ran this on a Windows 7 PC.

While it would not make sense, it's well documented behavior.

Documentation:

EQUAL? Function

If you compare two entries with the value not a number, NaN or an entry with the NaN value to an entry with a different value, this function always returns FALSE. Use the is not a number/path/Refnum? function to compare one or more entries with a value of NaN.

(even for different?)

Tags: NI Software

Similar Questions

  • Comparing a constant string with the procedure VARCHAR2 parameter

    Hello.
    I had a strange behavior of PL/SQL (propably I don't know something I should). I have a procedure:
    PROCEDURE przetworzLinie(P_LINIA VARCHAR2) IS
    BEGIN
      if not (nvl(pv_swde_section,'...') = 'SO') then
        CASE (p_linia)
          WHEN 'SN;' THEN      pv_swde_section := 'SN';
          WHEN 'SP;' THEN      pv_swde_section := 'SP';
          WHEN 'ST;' THEN      pv_swde_section := 'ST';
          WHEN 'SO;' THEN      pv_swde_section := 'SO';
          ELSE  NULL;
        END CASE;
      end if;
    -- (...)
    END;
    The procedure is called breast:
    procedure importuj(p_plik varchar2) is
      linia VARCHAR2(1000);
    begin
      pv_plik := p_plik;
      pv_plikID := otworzPlik(pv_plik);
      loop
        linia := czytajlinie(swde_file);     -- calls UTL_FILE.read_line and return a line from file
        exit when instr(linia, 'SWDEX') = 1; -- end of SWDE file
        przetworzLinie(linia);
      end loop;
    end importuj;
    The strange thing is that this procedure przetworzLinie never change the pv_secton_swde package variable, because the expresion:
    WHEN 'SN;'
    is always FALSE, even when p_linia contains "SN;" string.

    I solved this problem by replacing
    CASE (p_linia)
    with
    CASE (substr(p_linia,1,3))
    Please explain to me, why CASE (p_linia) is malfunctioning.
    Thanks in advance :)

    Published by: sandrine Sep 2, 2010 08:59

    P.s., database is 10.2.0.3.0 (64-bit)

    Check the length of the parameter p_linia and maybe a few extra spaces are added.

  • When I search something, firefox opens a new tab with the results. How can I change the settings to where it will stay all in the same tab?

    When I search something Firefox automatically opens a new tab with the results of this research. How can I change the settings to where the results will appear in the same tab where I made the research?

    If you want to open search results in a new window most often is a parameter of the search engine you use.

  • I have no sound on my computer (Windows XP). I installed audio driver with no result. What to do next?

    No sound

    I have no sound on my computer (Windows XP). I installed audio driver with no result. What to do next?

    Hi f. Mac,.

    Follow the steps in the article.

    How to troubleshoot sound problems in Windows XP

    No sound in Windows

  • Windows Update search updates with no results or returns the 8007000e error code. Windows Update Troubleshooter tried unsuccessfully

    Just installed Win7 Sp1 on Inspiron 1525 after you mount the new HARD drive. Works very well. However, Windows Update search updates with no results or returns the 8007000e error code. Tried troubleshooting of Windows Update without success. Indeed, I am unable to update Windows.

    Please run the Windows Update Troubleshooter:
    http://go.Microsoft.com/?linkid=9830262

    Please provide the exact details of any problem it reports as not fixed.

  • Compare Dot1Q and QinQ with access ports and trunk?

    Hi all

    How do you compare Dot1Q and QinQ with access ports and trunk?

    Thank you

    Sunil Kumar

    Hey, Sunil,.

    With regard to your questions:

    1. we have a case of Dot1Q configured on the port of access of habit?  If not, then why? - Dot1q aims to tag executives leaving the switch and access is opposite, it does not therefore not used together marking.

    2. how the topology would be for QinQ case? - For QinQ as I mentioned in my last post one side will be set to while links to access than others. A simple example is explained on this link:http://networklessons.com/switching/802-1q-tunneling-q-q-configuration-example/

    HTH.

    Kind regards

    RS.

  • Working with the results of the Action generated Poweshell

    Hello

    I have an action from orchestrator of a powershell script/function that I use regularly. The function is supposed to return a System.Object with email content (n, fromAdd, body, etc) that I would use in a script task.

    The problem I'm having is that I can't access these results in my work of scriptable. I know that the performance of the action a PowerShellRemotePSObject (and I have reviewed the literature on 'Working with PowerShell results'), but none of my attempts to explore the values give the results, I'm looking for. I'd appreciate any help to know what I'm missing.

    Thank you

    Thank you once again Ivo. Sorry for the delayed reactions. I took a peek at the solution you provided but had a few mistakes - there was no GetFilter() function defined for the call to psObject.getRootObject () .getProperty ('from'). After fiddling around with the results, I found my solution.

    I basically closed the rootobject of the return value of invocation of script that turns out to be a collection data structure (last result in the enumeration in italics/bold).

    .....

    rootObject var = psObject.getRootObject

    (rootObject element)

    {

    System.log (rootObject [index])

    }

    [10:43:33.159 2013-12-10] [I] DynamicWrapper (Instance): [PowerShellPSObject]-[class com.vmware.o11n.plugin.powershell.model.result.PSObject] - VALUE: com.vmware.o11n.plugin.powershell.model.result.PSObject@e9e592

    ....

    It turns out that the value of back in my Powershell script is the last element in the collection. from there, I could get my values:

    System.log (rootObj [rootObj.length - 1] .getProperty ("to"));

    System.log (rootObj [rootObj.length - 1] .getProperty ("from"));

    System.log (rootObj [rootObj.length - 1] .getProperty ("Subject"));

    System.log (rootObj [rootObj.length - 1] .getProperty ("body"));

    System.log (rootObj [rootObj.length - 1] .getProperty ("logFile"));

    I don't know if this will always be the case with psObject return values of Powershell called scripts, but several tests will help.

    Thanks for your time.

  • Construction of test with several results

    Hi, I have the question of Lilybyri:

    I'm learning to build test with several results from your article:

    Construction of Test with several results (CP5)

    That's exactly what I need. My question can I use the interaction of radio button or smart shape rather click on? What do you recommend? I used CP7 CP8.

    Need to publish the final test HTML5 and the output SWF. My test wil have 55 questions and 4 results score-one of them describe the personality of the learner.

    Yarik

    Advasntage to click on the button box and shape, it's that they have points

    attached to it. This is not the case for the interaction of radio buttons that has

    also limited formatting options.

  • Fill a table with the results of the refresh groups

    Hello world

    I need a little help.

    I'm working on an Oracle 10.2.0.4 on windows.

    I have a table I created like this:
    Table name: DIM_REPLICA

    COD_SEZ VCHAR2 (2)
    NOME_SEZ VCHAR2 (20)
    FLAG TANK (1)
    DATE OF D_REPLICA

    This DB I have 210 discount groups running every night. I need fill this table with the results of the refresh groups.

    So when the refresh for example called ROME group runs I need to write on the table the name ROME in the field "NOME_SEZ", a Y or N if the refresh Group has worked in the field of the INDICATOR and LAST_DATE refresh force ran into the field of the D_REPLICA. The COD_SEZ field is a code that I get other things. It is not necessary for the moment. I can add it myself on my own.

    Can someone help me please?

    I was looking on the tables SYS DBA_JOBS and DBA_REFRESH these data, but I don't know what to take and how to fill the table. Trigger? Procedure? Any help will be great!

    Thank you all in advance!

    This forum is for SQL * PLus, questions and your question is about general issues Oracle. You will get a better response by posting your question in another forum - probably the General database instance.

    Please close this thread and start over in another forum.

  • How to compare the new values with the old values in triggers.

    Dear all,

    Please tell me how to compare the new values with the old values in triggers.

    Hi, the employee example is in the document. You'd better read yourself.

    CREATE OR REPLACE TRIGGER Print_salary_changes
      BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
      FOR EACH ROW
    WHEN (new.Empno > 0)
    DECLARE
        sal_diff number;
    BEGIN
        sal_diff  := :new.sal  - :old.sal;
        dbms_output.put('Old salary: ' || :old.sal);
        dbms_output.put('  New salary: ' || :new.sal);
        dbms_output.put_line('  Difference ' || sal_diff);
    END;
    /
    
  • The results in the debugger do not correspond with the result in the xml output is spent OPA


    Hello

    I use the OPM Version 10.4.6. I am facing a problem where I have a result field which is calculated by OPM in session of the debugger gives the correct result. While the same field has a different value in the output xml file passed from OPA to another system. Please give some advice on above question.

    Kind regards

    Mounia

    Sorry, I did not respond earlier. Do you have a support call opened in this regard, otherwise there is someone who has a very similar problem.

    I answered internally on this and the problem seems to be that of mathematical accuracy and very low values, which are then compared with zero. The debugger uses a .net implementation that can give slightly different numerical values at the extremes. I think that your rules would benefit from a degree of rounding applied before you test for equality with anything. Note the type of value that I've seen is 4-16

    I have provided more information to Schneider, who also provided a (Simplified) modules and some sample data.

    The debugger uses essentially the same engine of determinations and in general, you will see exactly the same result except that you've discovered to some extremely small numbers. In your case even if the value is 4-16 in the debugger and 0 in the API (or vice versa) the effect that has on the logic is that a single value is zero, so that the other does not which translates an extra 1000 added and results of 1000 and 2000 respectively.

    Concerning

    Ian

  • Constant faults with satellite C660

    At the present time, I am more than just a little ticked off so I will try my best not to go off on a mug shot.

    Then I decided I would buy a laptop from Argos, I chose the Satellite C660 which cost me £300, and the first was faulty within weeks, it wouldn't read the Wifi card and I could not even anywhere near update even if that was the problem. So I had a second, worked well for 2-3 months, and then at the end of July it suddenly wrong.

    The error was with the hard disk, the hard disk had some how becomes corrupt, but firstly I decided I would buy recovery disks that cost £30 and took almost a week to arrive.

    Ultimately the recovery disks did not solve my problem so I rang the customer Service and they told me I could either send for repair, get a new hard drive sent me or send it to argos and get a replacement.

    Not even a month on the line and the SAME problems arose. Now I'm not sure that my anti virus was silly and allowed a virus to sneak into systems and corrupt once again, the concert stick which has been a cause of the second break was NOT used after to be sure.

    The anti-virus was Virgin Media Security Center, and even if some errors which is is past that have not been to painful difficulty it has worked well.

    But today, I uninstalled a program called Ventrilo so that I could reinstall it due to the fact that suddenly, she works correctly (suspect last night could be the beginning of my laptop once again to go to hell) last night, I used a Web site to see how I could completely remove ventrillo, and I followed the steps.

    As soon as I deleted the file ventrilo BAM the laptop went crazy! I rebooted, it don't think it would take just a reboot... once it is loaded, no background would show, a lot of error messages and I aircraft to the system restore 3 times. So I decided I want to reformat my laptop.

    That's where it went worse again, as soon as I entered the recovery disks the wrong hard drive shot, he began to reformat error only 5 seconds later saying no recovery of files found.

    Seriously toshiba, how much more portable that I am will have to be repaired or replaced before finally getting one that works 100%, why should not only claim a first thing in the morning, because ive got the reception has not been able to buy 3 years extra warranty (fortunately I still have 1 year of warranty) so I could do it now. im sick and tired of having a new piece of computer toshiba laptop for a short time then suddenly go faulty, especially when before you download anything, I make sure that I have downloaded to ensure responsible for anti-virus as his protégé.

    My moms laptop is HP and is 4 years old and STILL works very well, Yes, of course it heat up too much otherwise is based on a good surface, but still, how does a cell phone 4 years compared to a who apparently 3 months old laptop can work BETTER, is not what he supposed to be the other way around?

    EDIT: I just went through the forums, it seems that this brand has SO much go wrong with it in the first 3 pages only.

    Post edited by: Steelworkers

    Hello Steelworkers

    Sorry to hear (read) all that but what about?
    It's really funny in our life. With some things, we are more than satisfied and happy, but sometimes we just out of luck.

    Toshiba sells millions of laptops and probably thousands of Satellite C660 and there is always the risk that some of them are troublemakers. It is with other electronic products, cars, different machines and so on.

    I know you won t hear it but your only chance is to stay in contact with Toshiba service provider and if all goes well they will help you with all these issues.

    I must also say that over the last decade I have use Toshiba notebooks only. I had a few small problems too but it was always repaired quite quickly and I was able to continue my work.
    When you analyze markets for laptop, you will notice that the products are quite similar. You can't tell A manufacturer has much better quality than the manufacturer B. The level of prices is the same and the quality as well. What makes the difference is the hardware configuration and design, but all the rest is quite similar.

    One last thing: I agree with you on the old notebooks. I'm also sure that older models were much better, but what I can say for Toshiba tool Mr. I really missed some old models like Satellite 5200 or Satellite P20 of Mr. I had two of them, and I can say that they were ahead of the development and design.

    Bye and good luck.

  • How to fill the tables preset in Word 2003 with the results of the tests?

    Hi all

    I have a simple test, where I measure different levels of DC, with a simple Vi which records test results to a text file.

    These results in the text file, were manually typed in a test report, which is a Word document with tables, but I have now created a macro in word 2003 that can take the results to the text file and added to the precise lines and columns in my word test report file.

    Issues, it is how can I get Labview, after he measured the levels of DC, write the results of tests on specific tables, lines and columns, in the Word document without any delete?

    The attached photo shows a tables and the yellow cells showing the cells that must be filled in test results.

    To LabVIEW: 2009


  • How to trace the greatness of the variables compared to the timestamp with evenly spaced samples in time?

    Hello world. I need to trace the variable amplitudes compared to the timestamp (date and time), but the time intervals between samples are not equidistant. In my area, this is called trend plot. I'm surprised that Labview does not a vi to do this. The only solution that I found so far is to save the data in an Excel file and open this chart in Excel because it has the ability to trace what that this is against what whatsoever is not limited to something as even spaced samples. How to achieve this is Labview? A graph of waveform vi would be perfect if it was not by the fact that it works with even spaced samples.

    Thank you.

    Paulo Siqueira

    Your requirement is directly possible with LabVIEW.

    You can spend time to understand the difference between 'Chart', 'Graph' and "Graph XY".

    VI attached is drawing samples of unequal time.

    Hint:-right click on the 'XY' graph-> properties-> display-> 'Axis of X' = absolute time Format

    Kind regards

    Yogesh Redemptor

  • compares a scalar value with the elements of individual table 1 d

    Hi all

    I have a scalar value and a 1 d table. I want to compare scalar with every elements of the 1 d array and retrieve values that are higher than the scalar in a separate table 1 d.

    Can anyone suggest me how to go to that topic.

    Hi Luke,.

    OK, I convert vi in 2011.

Maybe you are looking for