Running this for loop makes it print 0.0099999999999997 followed by a huge negative number at the final step when it’s clearly supposed to print 0.01 followed by 0. Is this a bug or am I doing something wrong?
local yVal = 0
local lastY
for i = 1,100 do
if i <= 50 then
yVal = i/100
lastY = yVal
else
lastY = lastY - 0.01
yVal = lastY
end
print(yVal)
end