Jump to content
Developer Wiki and Function Reference Links ×

Is there a simple method to determine Odd/Even Integers?


Recommended Posts

Is there a simple way to determine if a number is odd or even? PASCAL math commands include ODD(x), but this appears missing from Vectorscript.

I tried ODD anyway, and got this error.

[font:Courier New] if ODD(wLights) then [do some stuff based on wLights];

|

{ Error: Identifier not declared. }

|

{ Error: Expected a string. }

|

{ Error: Expected a Boolean. }

|

{ Error: Did not expect this after end of statement - missing ;? }

[/font]

(wLights is declared, I think the error is asking about "ODD")

Alternately, is there perhaps a way to determine factors? I could simply check if a number is divisible by 2 or 3...

I might be missing something obvious, but I have honestly been scouring the language guide and the developer reference. I appreciate any ideas!

Link to comment

AE,

Perfectly legitimate use of the forum.

I posted this for my reference as much as yours. I have spent many hours looking in the Function Reference before remembering it is considered an "Operator" rather than a "Function" or "Procedure".

I have filed an enhancement request to get it all pulled together in one place.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...