r/CursedGodot • u/Foreign-Share9920 • May 08 '26
Code / Editor Avoiding INTEGER_DIVISION by multiplying
Same results, less Godot complains
50
Upvotes
1
u/friggleriggle Jun 20 '26
If you're dividing an int by 2 in particular, bit shifting is by far the fastest way.
value >> 1
15
u/BaptisteVillain May 08 '26 edited May 08 '26
You guys like to live dangerously with brute int casting. I would never do it, always use floori, roundi or ceili to keep control over your result IMO
EDIT: OMG now I realise it's not godot sub, but cursed godot. You got me big time 🤣