View Single Post
Old 22 February 2012, 22:07   #101
Global Moderator

prowler's Avatar
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,063
Originally Posted by Graham Humphrey View Post
Also, big thanks to dazzleman for his advice, it has certainly worked! I'd like to know what the MOD command actually does, just so I have a better understanding of it.
Hi Graham,

Sorry for butting in here (and I still haven't had much chance to really get started on following your progress yet), but I can answer this one for you.

Originally Posted by dazzleman View Post
If \y MOD 2=0 Then \y=\y-1
Next n

I assume that \y is an integer variable, right?

Well, the MOD function is a bit like divide, but the result is the remainder.

So, \y MOD 2=0 when \y is even, but =1 when \y is odd.

8 MOD 3=2, 11 MOD 4=3, etc.

EDIT: Hey, dazzleman was offline when I started posting!
prowler is offline  
AdSense AdSense  
Page generated in 0.04980 seconds with 9 queries