Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Can someone explain the Modulus option for me?
« previous next »
  • Print
Pages: [1] 2

Author Topic: Can someone explain the Modulus option for me?  (Read 9726 times)

Offline Meiscool

  • Staff
  • Exemplar
  • *
  • Posts: 1,138
  • I died for YOUR sins.
Can someone explain the Modulus option for me?
« on: August 04, 2012, 11:31:18 PM »
RPGM 2003. I tried reading up on what modulus mathematics are on wikipedia, but that kind of confused me even more than I already was about it. If someone could give me a simple explanation on how it would work in relation to variables, I would appreciate it.
Logged

Offline greenraven

  • That Guy
  • Zealot
  • *
  • Posts: 505
    • Angel Spire
Re: Can someone explain the Modulus option for me?
« Reply #1 on: August 04, 2012, 11:40:20 PM »
I can give you the definition of the word, but I'm not entirely sure what you are talking about.

Can you explain what you're trying to do? (What event you're trying to created?) :)
Logged

Offline Meiscool

  • Staff
  • Exemplar
  • *
  • Posts: 1,138
  • I died for YOUR sins.
Re: Can someone explain the Modulus option for me?
« Reply #2 on: August 04, 2012, 11:44:18 PM »
Nothing particular, just trying to see what it does so that I can utilize it if required.
Logged

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #3 on: August 05, 2012, 12:14:12 AM »
Mod is apparently usually used to find if a number is a multiple of another.
It's mostly described as "remainder of division", but I don't understand how the actual math behind it works.
Ed: http://en.wikipedia.org/wiki/Modulo_operation
« Last Edit: August 05, 2012, 12:18:54 AM by fruckert »
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #4 on: August 05, 2012, 12:27:51 AM »
The "absolute value" thing in computing is called "Abs", a totally different thing.
I know I'm right on this, because every programming language I've seen has called this specific thing Modulus.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline Meiscool

  • Staff
  • Exemplar
  • *
  • Posts: 1,138
  • I died for YOUR sins.
Re: Can someone explain the Modulus option for me?
« Reply #5 on: August 05, 2012, 12:35:48 AM »
Yeah, I think fruckert is on the right track here. Still don't know how it is usable though.
Logged

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #6 on: August 05, 2012, 01:36:28 AM »
The results of Modulo are very random if you don't know how it works.
Abs just returns the absolute value of a number.
It might be that, considering how many different moduli there are, but y'know.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #7 on: August 05, 2012, 01:43:57 AM »
It's what I said, then.
Try 12 mod 48.
It should equal 12.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #8 on: August 05, 2012, 01:55:34 AM »
^ what he said
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline Meiscool

  • Staff
  • Exemplar
  • *
  • Posts: 1,138
  • I died for YOUR sins.
Re: Can someone explain the Modulus option for me?
« Reply #9 on: August 05, 2012, 03:24:43 AM »
Ah. That will help a lot for collision detection with pixel movement and trig equations. Glad I asked.
Logged

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #10 on: August 05, 2012, 03:36:22 AM »
For the record, the math behind it is a - ( n * round( a / n ) )
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline Archem

  • One, one too many schizophrenic tendancies
  • Global Moderator
  • Over 9000!
  • *
  • Posts: 15,013
  • I made a fortune in toothpicks, but I lost it all in a fire.
Re: Can someone explain the Modulus option for me?
« Reply #11 on: August 05, 2012, 06:14:02 AM »
God, it's like a nerd convention up in here.
Logged

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #12 on: August 05, 2012, 06:22:59 AM »
Figuring it out gave me a geekasm.

Granted, it's useless for what I'm working on right now, but the knowledge is very helpful for the future.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

Offline Archem

  • One, one too many schizophrenic tendancies
  • Global Moderator
  • Over 9000!
  • *
  • Posts: 15,013
  • I made a fortune in toothpicks, but I lost it all in a fire.
Re: Can someone explain the Modulus option for me?
« Reply #13 on: August 05, 2012, 06:29:33 AM »
Do you mean "geekgasm", or perhaps the more common "nerdgasm"?

This comment gives me a grammar-boner.
Logged

Offline fruckert

  • Star-Star-Star-Star
  • Sage
  • *
  • Posts: 8,148
  • Not intended for public consumption
Re: Can someone explain the Modulus option for me?
« Reply #14 on: August 05, 2012, 06:33:54 AM »
Nope.
Geek-gasm.

Nerdgasm is, in my personal definition, gasm'ing over some sort of fiction.
Geekgasm is gasm'ing over technical ****.
I may have that backwards from normal, but that's what I usually define as the difference between nerds and geeks.
Logged
Quote
Ellie: I had a slice of ham in my hand. I was going to drop it, so I slapped it hard. It attached itself to the wall

  • Print
Pages: [1] 2
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Can someone explain the Modulus option for me?
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum