<leah2>
no, the average of an empty list is undefined
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
STASIdownunder has joined #ruby
<o0x1eef>
Average people aren't mathmeticians though, they won't understand undefined or NaN or whatever. Zero usually conveys something more sensicial. Anything else comes off as weird.
<leah2>
0 is just as arbitrary as 5
<o0x1eef>
From a UX standpoint? Not so sure. If I saw an average of 0 I'd assume "no average". If I saw NaN I'd think it is a bug, same for undefined.
<leah2>
but it's a bug :D
<o0x1eef>
Yeah fair enough, probably best handled with a very specific error message like "No results" or something.
<o0x1eef>
"Insufficient data" maybe.
STASIdownunder has quit [Read error: Connection reset by peer]
grenierm has quit [Ping timeout: 240 seconds]
gemmaro has quit [Ping timeout: 244 seconds]
gemmaro_ has joined #ruby
GreenResponse has joined #ruby
rhrf has quit [Ping timeout: 244 seconds]
STASIdownunder has joined #ruby
schne1der has joined #ruby
STASIdownunder has quit [Remote host closed the connection]
STASIdownunder has joined #ruby
STASIdownunder has quit [Read error: Connection reset by peer]
infinityfye has joined #ruby
patrick has quit [Ping timeout: 252 seconds]
patrick_ is now known as patrick
aesthetikx has quit [Ping timeout: 245 seconds]
sarna has quit [Ping timeout: 245 seconds]
__jmcantrell__ has joined #ruby
jmcantrell has quit [Killed (zinc.libera.chat (Nickname regained by services))]
__jmcantrell__ is now known as jmcantrell
jmcantrell_ has joined #ruby
aesthetikx has joined #ruby
user71 has joined #ruby
aesthetikx has quit [Ping timeout: 252 seconds]
aesthetikx has joined #ruby
nmollerup has quit [Quit: Leaving]
factor has joined #ruby
Rounin has quit [Ping timeout: 252 seconds]
<havenwood>
nakilon: It's coherent from a mathy perspective, where the sum of an empty set is zero and there are zero elements in the set. Zero divided by zero is undefined.
<havenwood>
In the cases where it makes sense to divide by zero, you usually want infinity.
hwpplayer1 has joined #ruby
<havenwood>
I'd for sure not want a number other than infinity, since it'd be just wrong and probably lead to a number of undiscovered bugs.
<havenwood>
Having an `exception: false` type thing that returns `nil` seems fine.
<havenwood>
Zero divided by zero is odder to me than other numbers divided by zero.
aesthetikx has quit [Ping timeout: 248 seconds]
STASIdownunder has joined #ruby
Rounin has joined #ruby
cappy has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]