3 ms·
Of course that code is broken (relies on undefined behavior) when i is zero, which is a totally reasonable input for a rotate function. A nice illustration of t
by pg314 8y ago
Of course that code is broken (relies on undefined behavior) when i is zero, which is a totally reasonable input for a rotate function. A nice illustration of the pitfalls of undefined behavior.
You can find a correct implementation in a blog post by John Regehr [1].
[1] https://blog.regehr.org/archives/1063 https://blog.regehr.org/archives/1063