Skip to content

Commit f3e7182

Browse files
committed
[BAEL-8472] - Fixed compile issues in kollin libraries
1 parent 3ce0294 commit f3e7182

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.baeldung.kotlin.junit5
2+
3+
class Calculator {
4+
fun add(a: Int, b: Int) = a + b
5+
6+
fun divide(a: Int, b: Int) = if (b == 0) {
7+
throw DivideByZeroException(a)
8+
} else {
9+
a / b
10+
}
11+
12+
fun square(a: Int) = a * a
13+
14+
fun squareRoot(a: Int) = Math.sqrt(a.toDouble())
15+
16+
fun log(base: Int, value: Int) = Math.log(value.toDouble()) / Math.log(base.toDouble())
17+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.baeldung.kotlin.junit5
2+
3+
class DivideByZeroException(val numerator: Int) : Exception()

0 commit comments

Comments
 (0)