3 ms·
One more instance where I just assumed that what GCC does was in the standard. Very interesting. For the curious who don't want to duplicate my look-up - right
by azernik 13y ago
One more instance where I just assumed that what GCC does was in the standard. Very interesting.
For the curious who don't want to duplicate my look-up - right shift is by definition division by two except negative signed numbers, for which it's implementation defined. GCC on every architecture I've checked uses arithmetic shift for signed, probably because that extends the base definition to negatives.