-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a modulo operator #192
Comments
Hey - Game of Life sounds really interesting. Which compiler/interpreter are you using to develop it? I like the idea of Right now, though, I'm working to get a stable 1.0 release candidate along with a proper regression test suite, which should be done in the next few days - once we've got that, I'm gonna triage any other feature suggestions for 1.0 and see if it's easy enough to add them without breaking anything. |
I use https://github.com/yanorestes/rockstar-py ; it gave me the best results so far, even if every interpreter has its own issues. Here's the Game of life implementation for anyone interested: https://github.com/sylvainpolletvillard/gameofrockstars |
Depending on the size of your numbers you could try something like this:
|
My numbers go from 0 to 2^64, so I would need a couple of these intermediate divisors, and it would still be very slow. |
That is absolutely amazing. Just... wow \m/ |
I'm not against the Modulo operator, but let me show you another, quicker solution for the Modulus function:
For a big number of 2^64 mod 1, it will end in 2*64 cycles. For smaller Numbers and bigger Divisors it is way faster. |
BTW, a
|
Yes, or vice versa, Your method is indeed way faster, good enough for my usage. But it only works for integers, so it cannot be applied for the Floor function shown above. |
@sylvainpolletvillard Glad to help you! |
Hi there,
We can already do pretty cool stuff using rockstar, but some basic features are lacking. At the top of my list: a modulo operator.
I know that you can already declare one using this function:
But unsurprisingly, it is painfully slow, especially when dealing with huge numbers.
Proposal:
{a} remains {b} - modulo
. Open to any other aliasesAs encouragement, know that this is the last thing that prevent me to finish my Game of Life implementation in Rockstar 👾
The text was updated successfully, but these errors were encountered: