-
March 17th, 2014, 04:16 PM
#1
math or if statement
Hello,
I at some point in my past was advised that sometimes using math to determine a thing was better than the actually logic, because the processing was shorter.
I don't remember what it was referring to, for, or if, or some sort of high-level shorthand
However, since then, I've been using math or mod instead of if's from time to time,
is that actually faster?
will the average future coder understand my use of mod?
eg, is it better to say:
for i from 0 to 10
whatever = i mod 5
or
for i from 0 to 10
if i < 5
whatever = i
else
whatever = i - 5
-
March 17th, 2014, 05:13 PM
#2
Re: math or if statement
If you use something that you feel that others won't find clear, add a comment.
-
March 17th, 2014, 09:27 PM
#3
Re: math or if statement
Neither one. They don't compile without End If.
Also, you don't use 'whatever'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|