From TinyMUX
Jump to: navigation, search


20px-Function.png iadd(number1[, numberN]...)

Returns the result of adding its integer arguments together. You may add up to 100 numbers in one iadd() call. Similar to add() except that the addition is done with 64-bit integer math (on both 32-bit and 64-bit platforms).

Related Topics: add(), dec(), idiv(), imul(), inc(), isub(), mod(), mul(), sub().


> say iadd(2,4)
You say "6"
> say iadd(5,3,7,-4)
You say "11"

Server Differences

TinyMUX is the only server to support this function. However, add() is equilvalent for numbers up to just under 2^53 or 9007199254740977. Also, add() on a typical machine takes about 44 us versus iadd() taking 2.8 us on the same machine -- or, about 16 times slower. For smaller numbers, add() special-cases to an integer code path and takes about 3.1 us -- or, only 10% slower.