Grasshopper shattered curve length precision problem

Hello! This is my first post here.
This might be a simple problem but I can’t seem to find an efficient solution on the previous forums.
I have shattered curves by a specific length (which is 2.5 in this case).
And then I want to sort out the shattered curves whose length equals my predefined length 2.5.
I have used Curve length component and Larger than or equal to component to sort out my desired curves. However, some of the curves that are 2.5 long are outputing False Boolean values. This is probably because of the precision of the curve length. I have tried to use Round component to round out the length, but it also doesn’t solve my problem because Integer, Ceiling and Floor values of 2.1 and 2.499999 are the same. Any suggestion will be appreciated.


unnamed.gh (12.7 KB)

Hello minjin,

How about this?


lengthCheck.gh (17.5 KB)

1 Like

Thank you, Masaki! This solves my problem.
I guess I need to learn C# asap.

Hello,

There is a trick if you want to round real numbers to a certain amount of digits after the comma.

RealRound.gh (7.2 KB)

1 Like

Thank you!