WG- Posted April 17, 2012 Report Share Posted April 17, 2012 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? Link to comment Share on other sites More sharing options...
crossrulz Posted April 17, 2012 Report Share Posted April 17, 2012 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. Link to comment Share on other sites More sharing options...
WG- Posted April 17, 2012 Author Report Share Posted April 17, 2012 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? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.