I have a dynamically changing input reading from a file. The numbers are either Int or Double. Why does Scala print .0 after every D
Int
Double
.0
D
Use type inference, rather than explicit typing.
scala> val xi = 1 xi: Int = 1 scala> val xd = 1.0 xd: Double = 1.0 scala> println(xi) 1 scala> println(xd) 1.0