(Glitch or...?) Number vs Text value-matching

Why would something like this happen? Is it normal?

I have a few zeroes in a list of numbers, yet both the equality and smaller than components report an inadequate output? The Match Text component seems to interpret the list correctly?

Only when I round the numbers results change:


Grasshopper shows a limited number of decimal places for clarity. You can adjust this in the settings to show more or fewer decimals.
Keep in mind that numbers smaller than this threshold will appear as zeros.

1 Like

Whenever working with (numerical) data make sure to never pipe it through a panel and use the panel output. As @Mahdiyar points out data gets formatted for the panel - an operation that will lose data. It isn’t necessarily exactly what the data truly is.

There are many topics on floating point arithmetic, equality and comparisons and how to deal that, also with Grasshopper, on this forum. Feel free to search on that :slight_smile:

Rounding is one way, using ‘fuzzy’ operators another. For the latter the equality is essentially checking the absolute difference of the two operands to some epsilon value. Say 0.00001. If |A-B| < 0.00001 then A and B are considered equal.

1 Like