Mod is an operator that is used in VBScript and VB.NET (and probably some other languages as well). C style languages use the % sign instead. >From the VBScript helpfile:
Description: Used to divide two numbers and return only the remainder. Remarks: The modulus, or remainder, operator divides number1 by number2 (rounding floating-point numbers to integers) and returns only the remainder as result. For example, in the following expression, A (which is result) equals 5. A = 19 Mod 6.7 -- David Rutten Robert McNeel & Associates On Nov 25, 1:43 am, djnelson75 <[EMAIL PROTECTED]> wrote: > Thanks that worked. Although is there some where that tells me what > "x mod 2" does. If feel like I might be missing out on some other > cool functions. > > On Nov 21, 2:31 pm, taz <[EMAIL PROTECTED]> wrote: > > > DJ, > > > Visose is absolutely correct, but just be sure that you're working > > with the most recent version of GH. > > > The 1 = True, 0 = False automatic conversion disappeared for a bit > > (briefly) but then David restored it. > > > taz > > > On Nov 21, 5:22 pm, visose <[EMAIL PROTECTED]> wrote: > > > > Use a function component with the following expression: "x mod 2" > > > It will return "1" for odd numbers and "0" for even numbers. If you > > > connect this directly to a dispatch component, 1 will become true and > > > 0 will become false. > > > > What the function component does is basically divide by 2 and returns > > > the remainder, even numbers divide by 2 without remainder so it > > > returns 0, odd numbers don't. > > > > On Nov 21, 10:17 pm, djnelson75 <[EMAIL PROTECTED]> wrote: > > > > > I was curious is the a comparison function that will determine if a > > > > number is even or odd. I have some function that is spitting out a > > > > number and what I want to do is if the number is even I want a certain > > > > configuration, but if it is odd then I want a different configuration. > > > > Any ideas on how to accomplish this?
