Ranges in Kotlin using data type Double
问题 fun calcInterest(amount: Double, interest: Double): Double { return(amount *(interest/100.0)) } fun main(args: Array<String>) { for (i in 1.0..2.0 step .5) { println("&10,000 at 5% interest is = ${calcInterest(10000.0,i)}") } } I get the error saying the For-loop range must have an 'Iterator()'Method. It underlines my doubles in the section (i in 1.0..2.0) How can I use doubles in a range?? A website on Ranges Reloaded (https://blog.jetbrains.com/kotlin/2013/02/ranges-reloaded/ ) shows that