DeltaV112 -> RE: Please add Modulo to S&S Editor Logic Syntax (5/14/2021 8:28:21 PM)
|
quote:
ORIGINAL: zgrssd If the game does any variable pruning, it might just be executed as "X % Y == X - X" Or X % Y == 0. And I would need to check if it even covers all cases properly mathematically. Plus either way, it is a pretty huge waste of calculation and excessively verbose code - for something that CPU's have hardware level support for [;)] If the game is doing pruning in this case it's a bug, no matter how you slice it divide then multiply by same value is not equivalent to doing nothing. And in performance terms it's irrelevant- your CPU can demolish math like this, and if this somehow does become a performance bottleneck modern CPU's can recognize idioms like this and change the instruction flow(if this were using a non-custom language the compiler would certainly recognize it).
|
|
|
|