Bill Allombert on Thu, 30 Mar 2023 20:10:50 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: bit_ffs


On Thu, Mar 30, 2023 at 07:02:34PM +0200, Ruud H.G. van Tol wrote:
> 
> Might be interesting to add:
> 
> https://en.wikipedia.org/wiki/Find_first_set
> https://www.man7.org/linux/man-pages/man3/ffs.3.html
> https://www.go4expert.com/articles/builtin-gcc-functions-builtinclz-t29238/
> 
> Or are those too low-level?
> 
> bit_ffs, bit_ctz

For the bitxxx functions family in GP, 
you can use valuation(x,2) (resp. logint(x,2))

Cheers,
Bill.