Jump to content
Sign in to follow this  
WG-

Issue with comparing 1D double array's

Recommended Posts

I was just creating a unit tests which compares to 1D arrays of doubles with each other. But it fails all the time while the data is actually equal to each other... Are there any issues now about comparing 1D double array's?

Share this post


Link to post
Share on other sites

I was just creating a unit tests which compares to 1D arrays of doubles with each other. But it fails all the time while the data is actually equal to each other... Are there any issues now about comparing 1D double array's?

This sounds more like an issue with comparing doubles. Remember that doubles (floating points in general) are not exact. If you are performing an equals with doubles, you will likely fail. Instead you should be checking for the doubles being within an accuracy range.

Share this post


Link to post
Share on other sites

Hmm yes I know but you mean to say when I divide 5 by 2 in native labview which would result in 2,5 may not be equal to 2,5 when I write it as a double constant?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.