The reason for 1 being displayed as the result is that compiler treats the division result to be an integer. The numerator and denominator in the expression are both integers hence the result. This can be avoided by explicitly type casting the data as float type.
Answers
Please see Why does 2 / 5 = 0 instead of 0.4?
thank you so much !!!
The reason for 1 being displayed as the result is that compiler treats the division result to be an integer. The numerator and denominator in the expression are both integers hence the result. This can be avoided by explicitly type casting the data as float type.
@GoToLoop - not sure why you have made these constants :-/ but anyway here are three more for your collection.