I would say println(sum) is more readable than println(var1.roundToInt() + var2.roundToInt()), which is very important in my opinion, but requires assigning a new variable. How does this affect app performance and memory usage? Is it technically more efficient to use println(var1.roundToInt() + var2.roundToInt()), whether this is the same? Maybe some optimizations happen when compiling an app? I'm mainly asking about Android app, but also interested in how it works in other platforms, systems, or programming languages. Thanks.
import kotlin.math.roundToInt
fun main() {
val var1 = 1.0 + 3.3
val var2 = 5.8 - 1.99
val sum = var1.roundToInt() + var2.roundToInt()
println(var1.roundToInt() + var2.roundToInt())
println(sum)
}