You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native U32.log2 retains the Base bit search in numeric folds #1710
On e5527d5, U32.log2 has no C intrinsic. Numeric folds keep the Base bit search instead of using the backend's existing CLZ operation. #1688/#1682 are the JS-specific work.
The native expression is 31 - CLZ(x | 1), so log2(0) stays 0 and there is no undefined zero-input CLZ. Base's Nat-valued result and checked definition stay unchanged.
Real behavior proof: the shared fixture in #1708 returns 29999970 in both arms for one million changing U32 values. Nine alternating CPU runs measured medians 2.825 ms before and 1.579 ms after. The permanent C/JS program checks zero, adjacent small powers, 2^31-1, 2^31 and 2^32-1.
Activity