From: Tom Tromey Date: Sat, 7 Jul 2018 05:44:30 +0000 (-0600) Subject: Make lognot handle bignums X-Git-Tag: emacs-27.0.90~4598^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c7e393bc4130c871a92fef7e9ac0c7c1832aa614;p=emacs.git Make lognot handle bignums * src/data.c (Flognot): Handle bignums. --- diff --git a/src/data.c b/src/data.c index d7175683c89..c9504694e37 100644 --- a/src/data.c +++ b/src/data.c @@ -3306,8 +3306,20 @@ DEFUN ("lognot", Flognot, Slognot, 1, 1, 0, doc: /* Return the bitwise complement of NUMBER. NUMBER must be an integer. */) (register Lisp_Object number) { - CHECK_FIXNUM (number); - XSETINT (number, ~XINT (number)); + CHECK_INTEGER (number); + if (BIGNUMP (number)) + { + mpz_t value; + mpz_init (value); + mpz_com (value, XBIGNUM (number)->value); + number = make_number (value); + mpz_clear (value); + } + else + { + eassume (FIXNUMP (number)); + XSETINT (number, ~XINT (number)); + } return number; }