- 2
Why is the answer to ((8+4)/2) 6.0 and not 6.
3 Antworten
+ 4
The answer of 6.0 would depend on the programming language for used. In most the result would actually be an int, when / is used, truncating the fractional portion. I'm guessing that you're using Python, since this seems to be the course you're doing. In Python the use of the / operator will result in a floating point number and the // operator will result in floor division or integer division.