The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
Somehow I imagine you, searching all your external drives: "Where is this damn VM... I have to test this!!! ARRRRGGGG"
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
I imagine you, searching all your external drives: "Where is this damn VM... I have to test this!!! ARRRRGGGG"
That's pretty much how it went. I used the GCC for the C version -- but had to log into my DigitalOcean droplet because it was easiest to write a command line C program there. I used my GIT bash shell to do the the bash shell one, etc.
I was searching all over the Internet for compiler VMs.
I actually tried to get it running in ADA, but couldn't.
It is hard to say 'wrong' or 'right'...
The Euclidean way is much more perfect (consistent) and fits better math as science, however Donald Knuth promoted an other way (called floored division), which found to be better for computer science and used by most languages today... Modulo operation - Wikipedia[^] - there is a nice table on the left side about programming languages...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Python and Ruby are garbage languages and I'm sure this will be their end.
-1%20 = 19 is so counter intuitive, I don't know how they reached that conclusion, however, we can see here that in Python the result of a modulo(%) operation has to be of the same sign and strictly smaller than the second operand.
And so python says
print 1%-20; = -19.
print -1%-20; = -1. (finally)
Someone needs to go back to the math class they hated.
I am not the one who knocks. I never knock.
In fact, I hate knocking.