Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ local function startTimer()

while myTimer:isRunning() do
-- Adding +1 makes sure the timer display ends at 1 instead of 0.
timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1))
timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1
-- By not setting the time for wait, it offers more accurate looping
task.wait()
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ Remember that module scripts are used to centralize similar code. Since the time
```lua
while myTimer:isRunning() do
-- Adding +1 makes sure the timer display ends at 1 instead of 0.
timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1))
timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1
-- By not setting the time for wait, it offers more accurate looping
task.wait()
end
Expand All @@ -378,7 +378,7 @@ Remember that module scripts are used to centralize similar code. Since the time

while myTimer:isRunning() do
-- Adding +1 makes sure the timer display ends at 1 instead of 0.
timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1))
timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1
-- By not setting the time for wait, it offers more accurate looping
task.wait()
end
Expand Down Expand Up @@ -492,7 +492,7 @@ local function startTimer()

while myTimer:isRunning() do
-- Adding +1 makes sure the timer display ends at 1 instead of 0.
timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1))
timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1
-- By not setting the time for wait, it offers more accurate looping
task.wait()
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ local function startTimer()

while myTimer:isRunning() do
-- Adding +1 makes sure the timer display ends at 1 instead of 0.
timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1))
timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1
-- By not setting the time for wait, it offers more accurate looping
task.wait()
end
Expand Down
2 changes: 1 addition & 1 deletion content/en-us/luau/metatables.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ For this one we will be using the `__index` metamethod just to make it simple:
```lua
local function mathProblem(num)
for i = 1, 20 do
num = math.floor(num * 10 + 65)
num = (num * 10 + 65) // 1
end
for i = 1, 10 do
num += i - 1
Expand Down
2 changes: 1 addition & 1 deletion content/en-us/reference/engine/libraries/bit32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ functions:
For positive displacements, the following equality holds:

```lua
assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp))
assert(bit32.rshift(b, disp) == (b % 2^32 / 2^disp) // 1)
```

This shift operation is what is called logical shift.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ end
RunService.Heartbeat:Connect(function()
-- Solves for the NumberSequence's time (between 0 and 1).
local t = time() / loopDuration
local numberSequenceTime = t - math.floor(t)
local numberSequenceTime = t - (t // 1)

-- Gets the NumberSequence's value at this time.
local brightnessValue = evaluateNumberSequence(brightnessCurve, numberSequenceTime)
Expand Down
8 changes: 4 additions & 4 deletions content/en-us/ui/3D-drag-detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ local function snapToWorldGrid(proposedMotion)
if startPartPosition == nil then
return proposedMotion
end
local snapIncrement = math.floor(SNAP_INCREMENT)
local snapIncrement = SNAP_INCREMENT // 1
if snapIncrement < 1 then
return proposedMotion
end
local newWorldPosition = startPartPosition + proposedMotion.Position
local roundedX = math.floor(newWorldPosition.X / snapIncrement + 0.5) * snapIncrement
local roundedY = math.floor(newWorldPosition.Y / snapIncrement + 0.5) * snapIncrement
local roundedZ = math.floor(newWorldPosition.Z / snapIncrement + 0.5) * snapIncrement
local roundedX = ((newWorldPosition.X / snapIncrement + 0.5) // 1) * snapIncrement
local roundedY = ((newWorldPosition.Y / snapIncrement + 0.5) // 1) * snapIncrement
local roundedZ = ((newWorldPosition.Z / snapIncrement + 0.5) // 1) * snapIncrement
local newRoundedWorldPosition = Vector3.new(roundedX, roundedY, roundedZ)
return proposedMotion.Rotation + (newRoundedWorldPosition - startPartPosition)
end
Expand Down
Loading