Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <z64555> Does anybody know how multiple compares are handled inside of an if statement?
- <z64555> if( (x == true) || (y == true) || (z == true) )
- <z64555> My guess is that the compares are evaulated before the branching/jump command is executed
- <z64555> but it's likely compiler specific
- <zookeeper> well i don't _know_ if it's true always, but i'd expect it to evaluate one after another and stop as soon as one evaluates to true
- <z64555> that would be the optimal execution speed, yes
- <zookeeper> i'm pretty sure no mainstream compiler would have all of them evaluated no matter what, but what i don't know is whether the language mandates that or not
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement