Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Modulous operator help

Author
Message
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 24th Apr 2006 00:52 Edited at: 24th Apr 2006 02:09
Sorry guys, can someone remind me of the modulous operator and how it works. I thought it was the % sign or a mod() function but I can't get either to work.

thanks

edit
oops I found it in the online help (they cut it short in the smaller user manual book)

it works like this

Editied again: MY EXAMPLE WAS COMPLETELY WRONG!!!!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 24th Apr 2006 01:22
Suggest you revise your logic. you correctly state that X MOD Y returns the remainder after division, but rest of your description is just wrong.



Easiest way to see how many tiles jumped, assuming you are using Y#

tiles=Y#/32

because tiles is an integer, it will divide by 32 and round down

Boo!
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 24th Apr 2006 02:08 Edited at: 24th Apr 2006 02:11
Yeah thanks spooky I just realized that as I was getting crazy number with mod. It is the remainder, but not what I wanted for my example. I'll give myself 3 hits on the head


11 mod 2 would equal 1
11 mod 3 would equal 2
32 mod 4 would equal 0
32 mod 11 would equal 10

you will always get values between 0 and mod value-1

It's good if you need to control values to wrap around a certain range.

And here I tried to make the thread useful.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Apr 2006 15:25
any positive integer (and 0) modded by 2 = 0 or 1

010101010101.....

that was the basis for my company name: mod2software

ok, its a bit silly....

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 24th Apr 2006 16:57
HAha CattleRustler. I never new what the name reffered to. Thanks for sharing that bit of info.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Apr 2006 19:34


Login to post a reply

Server time is: 2024-11-27 21:27:18
Your offset time is: 2024-11-27 21:27:18