]> git.eshelyaron.com Git - emacs.git/commit
Improve random bignum generation
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2022 00:21:55 +0000 (17:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 17 Mar 2022 00:52:41 +0000 (17:52 -0700)
commit2ef037c0dd3510a51ad73fdead1ded09848166f4
treea44593bba870cf70add2d0615efd07e3193926d9
parent31a2428d6f2ca792af18b43ceca5cec1ecce862f
Improve random bignum generation

* src/bignum.c (get_random_limb, get_random_limb_lim)
(get_random_bignum): New functions, for more-efficient
generation of random bignums without using Frem etc.
* src/fns.c (get_random_fixnum): New function.
(Frandom): Use it, and get_random_bignum.
Be consistent about signalling nonpositive integer arguments;
since zero is invalid, Qnatnump is not quite right here.
* src/sysdep.c (get_random_ulong): New function.
src/bignum.c
src/bignum.h
src/fns.c
src/lisp.h
src/sysdep.c