Grasshopper

algorithmic modeling for Rhino

anyone can help me, why i cant get the correct result of equality component? i tried to compare both of the list which are clearly have the same value. and ive tried list index component but still have the same problem :(

Views: 405

Replies to This Discussion

Hi Azan,

you're going to have to post some files so people can reproduce the problem.

Note that equality of floating point values is a finicky business as even the tiniest difference will result in inequality. I.e. 4.62938576298003 is not equal to 4.62938576298005, even though both may be displayed as 4.629386 in the Grasshopper interface.

If you want to test floating point numbers for equality, you almost always have to compute the absolute difference and compare that to a tolerance that makes sense for you. So instead of 'A = B', you need something along the lines of 'Abs(A-B) < 1e-8'

Points and Vectors suffer from the same problem because they consist of 3 floating points values each.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

thanks david, i get it. sory i forgot attached the screenshot. thanks 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service