Larger Than makes 1>1 true before Stream Filter in Anemone loop

anemone.gh (14.4 KB)

[Problem Background]
I try to make a simple growing(radius) circle along a random curve.
I use Stream Filter to navigate the flow back to the start point of the curve.
The radius of the circle and the positions of those are growing inside the Anemone loop.

[The Problem]
When the position reaches 1, the very end of the curve, the Loop End will not record that step, instead jump to the next step, in this logic, the start of the curve.

[My conjecture]
I am thinking the reason for that is the comparison component Larger Than will give the wrong result when the A and B inputs are both 1.

I am trying to figure out why.
Thanks!

You are doing floating point operations. I think you are assuming both inputs are 1, but in all likelihood your input in A is not exactly 1, maybe 1.000000004 or something like that.

Regarding floating point operations, try in Python:

print(0.1 + 0.1 + 0.1 == 0.3)

You can find on this discourse forum more posts and amazement about how computers and floating points work.

1 Like


Yes, you are right!
0.1 is actually not 0.1 here.
Thank you very much!