Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

math: integer division, modulo? #1064

Answered by vikstrous2
vikstrous2 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, yes, I was missing something obvious. Right after posting, I found a good way to do what I want:

x: idx-(math.Floor(idx/2)*2)
y: math.Floor(idx/2)

This solves my specific use case and hopefully it helps others, but working with numbers still feels a bit annoying.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by vikstrous2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants