Skip to content

Conversation

ckganesan
Copy link
Contributor

@ckganesan ckganesan commented Feb 23, 2024

Enhanced support for array inputs in the min and max built-in functions, now accommodating arrays of integers and floats. This update extends the functionality to handle diverse data types seamlessly, improving the flexibility and usability of the functions. #574

@antonmedv
Copy link
Member

Cool! What about adding support for this as well?

max([1, 2, 3], 10) // output 10

@antonmedv
Copy link
Member

But I think it will complicate things. We can add flatten() builtin.

@ckganesan
Copy link
Contributor Author

Cool! What about adding support for this as well?

max([1, 2, 3], 10) // output 10

Certainly, I can include that as well if you'd like.

@ckganesan
Copy link
Contributor Author

Cool! What about adding support for this as well?

max([1, 2, 3], 10) // output 10

Based on your feedback, I have also implemented this support as per your comment.

@antonmedv antonmedv merged commit ae180c8 into expr-lang:master Feb 24, 2024
@antonmedv
Copy link
Member

BTW, lets add this to https://expr-lang.org/docs/language-definition#mean and https://expr-lang.org/docs/language-definition#mean as well

@PranavPeshwe
Copy link
Contributor

Would be good to include some negative numbers in the tests.

@ckganesan ckganesan deleted the allow-array-min-max-builtins branch February 25, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants