4 ms·
Fun fact: in C, gcc and clang can(and will) replace the sum of n first integers with a loop (and slight variations) with Euler formula n(n+1)/2. Impressive.
by makapuf 6y ago
Fun fact: in C, gcc and clang can(and will) replace the sum of n first integers with a loop (and slight variations) with Euler formula n(n+1)/2. Impressive.
- benhoyt 6y agoWow, that is impressive, thanks. I confirmed this with godbolt.org at -O2.