3 ms·
Continuing the same line or reasoning, for integers, max([]) should be -inf and min([]) should be +inf. For positive numbers max([]) should be 0 and min([]) sho
by bjourne 3y ago
Continuing the same line or reasoning, for integers, max([]) should be -inf and min([]) should be +inf. For positive numbers max([]) should be 0 and min([]) should be +inf. But that's not how these operations are defined in most languages.
- edflsafoiewq 3y agoIt's certainly how they're defined in math. In fact all is just min and any is just max over the poset {True, False} with True > False. I think the reason we don't usually use those definitions is we like to maintain the fiction we're working with actual integers or reals, which don't have a min/max.
- xigoi 3y agomin and max are in fact defined this way in JavaScript.