Code examples for lotharschulz.info - How to: Nulls and Exceptions in Kotlin from github.com/lotharschulz/kotlin-null
fun reciprocal(i: Int): Double =
when(i == 0){
true -> throw IllegalArgumentException("Can not take reciprocal of 0.")