[BAEL-8472] - Fixed compile issues in kollin libraries

This commit is contained in:
amit2103 2018-09-09 16:10:07 +05:30
parent 3ce0294470
commit f3e7182257
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,17 @@
package com.baeldung.kotlin.junit5
class Calculator {
fun add(a: Int, b: Int) = a + b
fun divide(a: Int, b: Int) = if (b == 0) {
throw DivideByZeroException(a)
} else {
a / b
}
fun square(a: Int) = a * a
fun squareRoot(a: Int) = Math.sqrt(a.toDouble())
fun log(base: Int, value: Int) = Math.log(value.toDouble()) / Math.log(base.toDouble())
}

View File

@ -0,0 +1,3 @@
package com.baeldung.kotlin.junit5
class DivideByZeroException(val numerator: Int) : Exception()