If you call your bank and ask them what the sum of all of your deposits this month is, and there are none, does your bank say "I can't answer that because there aren't any" or "$0.00"1 ?
You may have a difficult time understanding what the sum of zero items is. The authors of Scalar::Util may have a hard time understanding. But that doesn't prevent some of us from understanding that very clearly and knowing that, mathematically, the sum of zero items is actually well-defined and is simply 0. Similarly, the product of zero items is 1 ($x**0 is 1, and even 0**0 is 1).
It is similar to the author of Term::ReadKey not understanding that for ReadKey($delaySeconds), ReadKey(0) is not a special case and should mean "delay 0 seconds, returning immediately" and it makes no sense for them to have defined ReadKey(0) as "wait forever" and ReadKey(-1) as "wait 0 seconds". Many people have trouble seeing this, but that doesn't mean it isn't true.
1 Or using whatever currency your account is in.
- tye
In reply to Re^6: List::Util::sum() and empty lists... (obvious)
by tye
in thread List::Util::sum() and empty lists...
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |