Hello, how can I get only even numbers from a random float list of even numbers in grasshopper?

i can get only even numbers from integer random numbers.

What does that mean? I donâ€™t understand your brief description

3. Attach minimal versions of all the relevant files

I want get even numbers from float numbers listâ€¦

but i just can get even numbers from integer numbers list.

so, how can get even numbers from float numbers?

Looks like you need either:

- a tolerance on the comparison

or - some rounding when generating the numbers in the sequence

1 Like

If I understand you, you want the numbers whose last decimal digit is an even number:

evens.gh (12.1 KB)

1 Like

<â€” not a GH expert so Iâ€™m making some assumptions about how the components in the screenshot work.

My assumption had been that he wanted numbers which â€śshouldâ€ť be even, such as 8.0 in his screenshot, to make it through the list.

Because heâ€™s interpolating between values by adding a non-integer increment between them, sometimes the answer isnâ€™t â€śquiteâ€ť right.

In the screenshot, his 4.0 is â€śclose enoughâ€ť to 4 for the comparison to succeed but 8.0 is probably something like 7.99999 and fails.

2 Likes