Commit c7e393bc authored by Tom Tromey's avatar Tom Tromey
Browse files

Make lognot handle bignums

* src/data.c (Flognot): Handle bignums.
parent 0d868917
......@@ -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));
if (BIGNUMP (number))
mpz_t value;
mpz_init (value);
mpz_com (value, XBIGNUM (number)->value);
number = make_number (value);
mpz_clear (value);
eassume (FIXNUMP (number));
XSETINT (number, ~XINT (number));
return number;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment