How does this assertion work in the following example:
fun sqrt(x: Double): Double {
require(x >= 0) { "Invalid argument" }
return Math.sqrt(x)
}How does this assertion work in the following example:
fun sqrt(x: Double): Double {
require(x >= 0) { "Invalid argument" }
return Math.sqrt(x)
}Create a free account to access the full topic