Back to questions
JuniorTheoryCommon
What does the program print?
print(Int(3.99), Int(-3.99))3 -3
- Expecting
4 -4: thinkingInt(…)rounds. It drops the fractional part, soInt(3.99)is3. - Expecting
-4for the negative number: dropping the fraction moves a number toward zero, soInt(-3.99)is-3.
- How do you round
3.99to the nearest whole number before converting it? - What does
Double(3)give, and does that conversion lose anything?