0
I'm confused with which how Kotlin utilizes order of operations and significant figures.
Mainly regarding my issues with the "Parking Fees" assignment. An example of an error was 1*hours vs hours*1.0 where the latter gave me the correct output.
1 Odpowiedź
+ 3
Multiplication is commutative, even in Kotlin, that means a * b = b * a
However, the data type of the result does depend on the type of the operands.
If you multiply two integers, the result will also be an Int.
If you multiply an Int and a Double (no matter in which order), the result will be Double.