voltrevo/vortex

[FEATURE REQUEST] Floor division

Opened this issue · 3 comments

I'd really like to be able to do floor division on my operations. Can this please be implemented? I'd expect syntax similar to Python ( a // b).

Hmm // would conflict with comments in a C-family language like Vortex.

Using integer types forces floor division, when those are available would you still have much desire for floor division with floats? That might be better as a standard library function like floorDiv but I'll have to think about it.

I would want a floorDiv standard function, but having integer division would also work. I wouldn't want to have to cast my floats to integers every time I want floor division, so having an in-built function would be important in my eyes.

Ok cool. There isn't a standard library to add this to yet, so I'll leave this open to keep track of it.

Btw, I think I mentioned it before, but I'll document it here - there's a workaround for this in the meantime:

func floor(x) => x - (x % 1.0);
func floorDiv(a, b) => floor(a / b);