Difference between revisions of "Talk:Abs"
no edit summary
imported>DragoonWraith |
imported>DragoonWraith |
||
Line 4: | Line 4: | ||
:It is sad. I think your script is doing too much, personally, since you're making two comparisons when only one is needed. This would be more efficient (though slightly longer to write): | :It is sad. I think your script is doing too much, personally, since you're making two comparisons when only one is needed. This would be more efficient (though slightly longer to write): | ||
if ( A < 0 ) | if ( A < 0 ) | ||
set A to -A | set A to -A | ||
else | |||
set A to A | |||
endif | endif | ||
:Ultimately, this page is more for the OBSE function Abs than how to achieve the same effect without OBSE. Achieving it without OBSE is decidedly trivial, if tedious to write, so I'm not sure if we should keep your code here or not. For now, I'm leaving it, but I may remove it; I'm going to see how the other functions handle this issue. | :Ultimately, this page is more for the OBSE function Abs than how to achieve the same effect without OBSE. Achieving it without OBSE is decidedly trivial, if tedious to write, so I'm not sure if we should keep your code here or not. For now, I'm leaving it, but I may remove it; I'm going to see how the other functions handle this issue. |