Fix misleading name ‘double_to_bignum’

* src/bignum.c (double_to_integer): Rename from double_to_bignum,
since the result is not necessarily a bignum.  All uses changed.
This commit is contained in:
Paul Eggert 2018-09-10 08:59:39 -07:00
parent fe859a0787
commit 10a4509698
4 changed files with 5 additions and 5 deletions

View file

@ -64,9 +64,9 @@ bignum_to_double (Lisp_Object n)
return mpz_get_d (XBIGNUM (n)->value);
}
/* Return D, converted to a bignum. Discard any fraction. */
/* Return D, converted to a Lisp integer. Discard any fraction. */
Lisp_Object
double_to_bignum (double d)
double_to_integer (double d)
{
mpz_set_d (mpz[0], d);
return make_integer_mpz ();

View file

@ -4657,7 +4657,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
/* Characters to be inserted after spaces and before
leading zeros. This can occur with bignums, since
string_to_bignum does only leading '-'. */
bignum_to_string does only leading '-'. */
char prefix[sizeof "-0x" - 1];
int prefixlen = 0;

View file

@ -391,7 +391,7 @@ rounding_driver (Lisp_Object arg, Lisp_Object divisor,
if (! FIXNUM_OVERFLOW_P (ir))
return make_fixnum (ir);
}
return double_to_bignum (dr);
return double_to_integer (dr);
}
static EMACS_INT

View file

@ -3327,7 +3327,7 @@ extern ptrdiff_t bignum_bufsize (Lisp_Object, int);
extern ptrdiff_t bignum_to_c_string (char *, ptrdiff_t, Lisp_Object, int);
extern Lisp_Object bignum_to_string (Lisp_Object, int);
extern Lisp_Object make_bignum_str (char const *, int);
extern Lisp_Object double_to_bignum (double);
extern Lisp_Object double_to_integer (double);
/* Converthe integer NUM to *N. Return true if successful, false
(possibly setting *N) otherwise. */