[ANSWERED]Still a bit confused on the difference between / and // | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

[ANSWERED]Still a bit confused on the difference between / and //

I know it is a simple question with a simple answer. I am fluent in lua which deals with alot of math so I know I am just overthinking it. Thank you in advanced!

9th Jun 2021, 2:47 PM
WebFreak
WebFreak - avatar
2 Answers
+ 1
Hunter MacInnes / is normal division which returns value in float // is floor division which returns value in int without decimal part So 5 / 2 = 2.5 5 // 2 = 2 4 / 2 = 2.0 4 // 2 = 2
9th Jun 2021, 2:50 PM
A͢J
A͢J - avatar
+ 1
/ results in a float. its regular division // returns an int. its division that disregards remainders. ex. 11 / 2 == 5.5 11 // 2 == 5
9th Jun 2021, 2:51 PM
Slick
Slick - avatar