rem - 3 months ago 12

R Question

What is the time-complexity of arithmetic operations in R? E.g. is multiplication of two 32-bit integers constant-time?

Answer

If you look here you'll see that in R, integer multiplication simply calls the C integer-multiplication operator. So the only answer I can give to "what is the time complexity of integer multiplication in R?" is "the same as the time complexity of integer multiplication with whatever C compiler has been used to compile R"; the answer to *that* question will usually be "the same as the time complexity of the integer-multiplication machine instruction (e.g., `IMUL`

) on the particular chip on which you are running".