Hi guys, I want to know, what’s diffirence between math.floor(x/y)
and x//y
? And if there’s none, why they both exist?
If looking to performance, x//y
outweights twice:
Benchmark code
local start = os.clock()
for i = 1, 1000000, 1 do
local a = math.floor(i/7)
end
print("math.floor(x/y):", os.clock()-start)
start = os.clock()
for i = 1, 1000000, 1 do
local a = i//7
end
print(" x//y:", os.clock()-start)