
Hi, On 13/11/2021 00:13, james faure wrote:
Why is there no `countLeadingZeros` function for Integer? This seems particularly strange because gmp provides /mp_bitcnt_t/*mpz_scan0*/(const mpz_top, mp_bitcnt_tstarting_bit)/ Integer is not always implemented with GMP.
More importantly, what is the recommended way to access it? If you do have an Integer implemented with GMP (the default case with GHC), you can use one of
https://hackage.haskell.org/package/hgmp-0.1.2/docs/Numeric-GMP-Raw-Safe.htm... https://hackage.haskell.org/package/hgmp-0.1.2/docs/Numeric-GMP-Raw-Unsafe.h... together with https://hackage.haskell.org/package/hgmp-0.1.2/docs/Numeric-GMP-Utils.html#v... See the example at the top of that module page. Claude -- https://mathr.co.uk