Floor divide operator // doesn't work; docs say it does

I want to use the floor division (int division) operator //. Luau documentation (1) (2) claims to support this. The Roblox script editor red-underlines the second / and errors with Expected identifier when parsing expression, got '/' when run.

Is this a bug? Does Roblox support the // operator or not?

NOTE: I know math.floor(a / b) works; that is not my issue. I am specifically asking about the // operator.

Lua 5.3 huh?

Roblox does not use Lua 5.1 anymore. Look at the Luau documentation I linked. It directly specifies support for the // operator among other Lua 5.2~5.4 features.

Hmm, it seems to classify as a bug then. I’m not sure if it’s intentional or not, so then I suggest talking with an engineer about it

It works now! Looks like it got fixed somewhere in versions 599 - 601. Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.