Grasshopper

algorithmic modeling for Rhino

Finding the Minimum and Maximum of a lsit of numbers

I have been trying to find the minimum and maximum of a list of numbers. The list of numbers are fed into the input of a function component.  I then put the expression Max(x).  Although there are no errors, the output is simply the list of number again.  I have tried flattening the list but all to no avail.

Many thanks

Views: 197

Replies to This Discussion

Min and Max only work on 2 numbers. They return the highest or lowest one.
You want to use the Bounds component to create an Interval (Domain) that contains all the numbers in a list.

You could also sort the list of numbers, then retrieve the first and last element in the sorted list.

--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service