max and min

13 views
Skip to first unread message

Bruce Sherwood

unread,
Mar 21, 2015, 1:40:16 PM3/21/15
to rapyd...@googlegroups.com
I only just now noticed that Math.max and Math.min seem very strange, since one must write Math.min(x, y, z) and Math.min([x, y, z]) is not legal. The standard Python functions take lists, which seems vastly more useful. So a naive question: Would it make sense to have RapydScript max and min functions accept lists? 

Alexander Tsepkov

unread,
Mar 21, 2015, 2:01:30 PM3/21/15
to Bruce Sherwood, RapydScript
You're right, I'll look into adding these wrappers to baselib. I do like that JavaScript puts them into Math module rather than dumping these methods in global scope, like Python. In the meantime, another workaround for this is Math.min(*[x, y, z]).
Reply all
Reply to author
Forward
0 new messages