Return NaN as an average of an empty collection.

#KT-15399 Fixed
This commit is contained in:
Ilya Gorbunov
2017-01-27 01:57:21 +03:00
parent 6704ba05de
commit 01f53d0173
9 changed files with 51 additions and 51 deletions
@@ -36,7 +36,7 @@ fun numeric(): List<GenericFunction> {
sum += element
count += 1
}
return if (count == 0) 0.0 else sum / count
return if (count == 0) Double.NaN else sum / count
"""
}
}