CGBN icon indicating copy to clipboard operation
CGBN copied to clipboard

Log and log1p support

Open touisteur opened this issue 3 years ago • 1 comments

Hi,

Reading through the code, searching w/ github, I couldn't locate an implementation of log or log1p. Did I miss something? Is support for those foreseen some day? Is there a trick I'm missing here?

Thanks in advance for your help.

touisteur avatar Sep 01 '21 07:09 touisteur

If you are looking for integer log you can approximate it with clz

truncate(log2(n)) = BITS - clz(N) - 1

sethtroisi avatar Sep 03 '21 08:09 sethtroisi