Idea

Steven Hamoen avatar image
10 Likes"
Steven Hamoen suggested Matthew Gillespie commented

Add min, max functions to the Array class

I was looking for the listmax function but it says: "Deprecated, use the array class"

But the array class does not have a max property. So it would be nice if max, min would be added.

Other option would be if the max method of the Math class would accept an array but I guess that is less intuitive

arrayclassmax
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@steven.hamoen, until there is a method, you can use a table.query ordered ascending or descending to get min or max value.

table.query on an array

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Joerg Vogel commented ·

@Jörg Vogel Thanks I'm aware of that but this is case of just 9 numbers in a table so a query would create a lot of overhead. I currently used the findmax() function.

1 Like 1 ·

1 Comment

Matthew Gillespie avatar image
4 Likes"
Matthew Gillespie commented

We have plans to add an overload to Math.min and Math.max that takes an array. This should satisfy this request and this one.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Noah Z avatar image Noah Z commented ·

@Matthew Gillespie Has this functionality been added in yet?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Noah Z commented ·

No, not yet. We might be able to get it into 19.2.

0 Likes 0 ·

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.