11-29-2022, 12:05 AM
Operator MOD
|
11-29-2022, 12:10 AM
(11-28-2022, 11:46 PM)Kernelpanic Wrote: I just use Julia for that. . . I also installed it because the name turned me on so much.Ohh.. "Do it to Julia! Do it to Julia!!!" Traitor. Dumbo-cough. ROFLMAO. Thanks Winston for putting "1984" as one of the most disappointing things I had to read, after the somewhat amusing "Animal Farm" by George Orwell. Darn it loved "Boxer" the horse the most. The soldier, only knew how to follow, and the strongest. Thus when he died in the story I cried. Just before that, "Benjamin" was running after the wagon that held his best friend yelling at the other animals to help him rescue "Boxer". "Boxer fight for your life, they're going to take you to the glue factory!" Anyway this has been one of my favorite ladies' names for a long time: https://en.wikipedia.org/wiki/X-23 Also like "her clone's" name but that's more for a Venezuelan family serial actress LOL. Not official shortened name though, that's from me. Sorry, off-topic and this is a very depressing time of year coming up for me...
11-29-2022, 12:25 AM
(This post was last modified: 11-29-2022, 12:32 AM by Kernelpanic.)
Quote: The soldier, only knew how to follow, and the strongest. Thus when he died in the story I cried. Off . . . Are you interested in history - and the history of mankind is a history of war? Then I recommend you the history of the American Civil War (if you don't already know it) for example: "Battle Cry Of Freedom - The Civil War Era", James M. McPherson BATTLE CRY OF FREEDOM: The Civil War Era
11-29-2022, 12:35 AM
(11-29-2022, 12:00 AM)Pete Wrote: Nice! That's a keeper. I remember those days of 58008 glory. When you think about it, the Negative MOD of a number has to be the same as the positive MOD. After all, how do you get MOD to begin with?? Repetitive subtraction! 27 MOD 5 27 - 5 22 - 5 17 - 5 12 - 5 7 - 5 2 - 5... can't subtract so 2 is the answer. 27 MOD -5 27 + -5 22 + -5 17 + -5 12 + -5 7 + -5 2 + -5.... can't add so 2 is the answer. Subtract one... add the other... The trick is to always approach zero. As D.J. Keith stressed for us, "that + and - is just *direction* you're traveling in." In this case, you always want to travel towards 0, to find your answer. (X MOD Y)= (X MOD -Y)... They're basically the same, as far as I can tell.
11-29-2022, 12:36 AM
We usually get off topic after a thread has been properly beat to death. I rather like that, in fact.
Also at mn, sorry to hear this time of year is depressing for you. If it's seasonal depression, I get it. I don't know what I'd do outside the sunny skies of Cali. I've had older friends who moved to Oregon, and wish they could move back. Anyway, stay tuned to the Phoenix forum. Steve and I will be sure to turn up the heat here this winter. Oh, and for my many friends from Australia, who Thanksgiving was completely lost on... Happy 4th of July! Pete
SAD? When it's pitch black at 5 PM and clouds roll in from over the lake and stay to about March, it definitely gets bleak in N. Ohio.
But now we have Modulus for Negative numbers!
b = b + ...
11-29-2022, 01:42 AM
Hey remember when the mid-west actually had seasons? 1960 - 1970 something. Things started to change in the 1980's. Mostly summer and winter with a couple weeks of transition. That was real climate change. Not the BS we keep hearing about today.
Well I hoe Chris can actually make use of what we came up with in this thread. I mean any keyword is basically a function running in the background, so when he states none of these functions will meet his requirements, I wonder how on earth a single keyword might? Is it just more involved as in floating point differences? I didn't bother to get that far down this rabbit hole. Pete (11-29-2022, 12:35 AM)SMcNeill Wrote:(11-29-2022, 12:00 AM)Pete Wrote: Nice! That's a keeper. I like this explanation, points me towards getting a handle on floats, and thanks for simplifying Pete's ABS & SGN laden thing!
b = b + ...
11-29-2022, 06:24 AM
Another simple explanation for you @bplus:
Think of what MOD is... It's the remainder after division... nothing more, nothing less. INT(27 / 5) = 5 5 * 5 = 25 27 - 25 = 2 2 is the remainder. INT(27 / -5) = -5 -5 * -5 = 25 27 - 25 = 2 2 is the remainder. INT(-27 / 5) = -6 5 * -6 = -30 -27 - -30 = 3 3 is the answer. It's that simple.
11-29-2022, 06:34 AM
Maybe this SUPER simple formula will show how it works:
Code: (Select All) For i = -10 To 10 And this even showcases how QB64 gets the answer that it goes for us, with ModX3. INT(x / y) is NOT the same as x \ y. |
« Next Oldest | Next Newest »
|
Users browsing this thread: 35 Guest(s)