I'm mainly waiting for C# to move over a game maker project to Godot, but I have one question.
Doesn't GDScript have div? I know / and % is generally the same thing but they do sometimes give different results.
What's div? Is it a division operator? If so, the only division operator I've used along all my life was just /
Can you show us an example of the different results you mentioned?
_tileSize = 32;
_tilew = _tileSize
_tileh = _tileSize
_tileX = x div _tilew
_tileY = y div _tielh
/ works but doesn't snap the object in place like div does, also it's very common in C#, C++, etc.
Looking at the documentation for div (for C/C++) it looks like it divides and returns both the quotient and the remainder in a struct.
Probably the reason you're getting different values is that your using the quotient when you're calling div, while / returns the quotient plus the remainder. You can get the quotient with GDScript using floor(x / y) and the remainder with (x/ y) - floor(x / y), or you might be able to use (x % y) to get the remainder if GDScript supports it.
floor(x / y)
(x/ y) - floor(x / y)
(x % y)
Alright, now I got, thanks @TwistedTwigleg .
Another way to get the quotient is casting the numbers to int:
var a = 7.0
var b = 5
var quotient = int(a) / int(b) # 1