Jump to content

Issue with comparing 1D double array's


WG-

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?

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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