Here’s an example for a function summing two numbers:

```
fun sumNumbers(num1: Double, num2: Double): Double = num1 + num2
fun main() {
val sum = sumNumbers(5.0, 34.0)
println(sum)
}
```

Just as a reminder, when we say Integer and Double, we aren’t talking about numbers like we do learning math–instead we’re talking about **types**. It’s reasonable to say whole numbers and integers are a subset of rational numbers. An `Int`

in programming is not a subtype of `Double`

.

Checking if an `Double`

is an `Int`

is not checking if it’s a whole number. You might as well check if a `Double`

is a `File`

or `String`

```
import java.io.File
fun main() {
//sampleStart
5.0 is File
5.0 is String
5.0 is Int
//sampleEnd
}
```

If what you really want is to check if a `Double`

is a whole number, you can do that a few different ways. Here’s an example using `compareTo`

:

```
fun isWholeNumber(num: Double): Boolean {
return num.compareTo(num.toInt()) == 0
}
fun main() {
val wholeDouble = 5.0
println(isWholeNumber(wholeDouble))
val nonWholeDouble = 5.0000001
println(isWholeNumber(nonWholeDouble))
}
```