0
Tping error in example
Not a question but 15/4 is not = 3
4 ответов
+ 6
depends on who you ask.
ask an int and they will say it is 3.
ask a float and they will say it is 3.75
http://stackoverflow.com/questions/4685450/why-is-the-result-of-1-3-0
+ 6
15/4 is 3.75.Since computers like integers , it is 3.
(Integers or int means to store a number without decimal)
If you use 15f/4 or 15/4f (in java), it will give 3.75, f stands for float(which is just a data type to hold decimal numbers like 2.8 or 2.000000000264)
+ 5
It is 3 @Katherine,
Such expressions in (I think) every programming language results integer value (quotient only).
Thus, 15/4= 3, 8/5=3 etc.
0
In Java it is. If you want 3.75 you have to divide 15.0/4