- Home /
Using multiples of 360 in if statements.
Hello, in my code I have a function that can only be executed if an integer isn't equal to a multiple of 360.
var exampleNumber : int;
if(exampleNumber != // a multiple of 360)
{
// do something
}
I think I have to use arrays but I haven't got a clue how. I've searched some information concering arrays but with no result.
Thanks in advance!
Answer by Eric5h5 · Nov 04, 2011 at 06:17 PM
if (exampleNumber % 360 != 0)
Thank you. I have another little question. What does '%' means? Is it the same as '/'?
Answer by cj_coimbra · Nov 04, 2011 at 06:13 PM
Instead, try making a function that returns bool type and receives the desired number as argument. Do desired number/360 If the remainder is 0, then your number is multiple of 360 and the function returns true. Does this make any sense?
This makes sense but the solution below is more simple. Thank you anyway for the effort
Your answer
Follow this Question
Related Questions
Error with an Array 1 Answer
Javascript array questions. 1 Answer
2D 360 degress platformer example needed 0 Answers
Calculating the total of an int Array 2 Answers
Check/compare array elements 1 Answer