Explain this question please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Explain this question please

print Math::PI.ceil +1 print Math::PI.floor -3 #answer is 50

1st Jan 2018, 10:16 AM
Arfaan
Arfaan - avatar
3 Answers
+ 5
Math::PI is approximately 3.14 .ceil round it to the nearest superior integer (here 4) 4 + 1 = 5 .floor round it to the nearest inferior integer (here 3) 3 - 3 = 0 print do not put a 'end of line' so the result is 50
1st Jan 2018, 10:22 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 2
you are welcomed :)
1st Jan 2018, 12:16 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
Thanks. I didn’t knew what the ceil and floor methods do. Thanks for explaining it to me
1st Jan 2018, 11:04 AM
Arfaan
Arfaan - avatar