aboutsummaryrefslogtreecommitdiffstats
path: root/src/floatfns.c
diff options
context:
space:
mode:
authorTom Tromey2018-08-07 18:08:53 -0600
committerTom Tromey2018-08-07 18:08:53 -0600
commitd1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8 (patch)
tree04c920acf142f686d3cac11080b17a2fb0dfc9af /src/floatfns.c
parent68ebff23f7057090da260830500cb278f7b886a5 (diff)
downloademacs-d1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8.tar.gz
emacs-d1ec3a0a8e4d7d56ebc1e4fa743130b9974ac6a8.zip
More macro renamings for bignum
* src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c, src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c, src/category.c, src/ccl.c, src/character.c, src/character.h, src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c, src/composite.c, src/composite.h, src/data.c, src/dbusbind.c, src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c, src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c, src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c, src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c, src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c, src/indent.c, src/insdel.c, src/intervals.c, src/json.c, src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c, src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c, src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h, src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c, src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
Diffstat (limited to 'src/floatfns.c')
-rw-r--r--src/floatfns.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index 563c65f827a..f8463f32445 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -194,7 +194,7 @@ EXPONENT must be an integer. */)
194 (Lisp_Object sgnfcand, Lisp_Object exponent) 194 (Lisp_Object sgnfcand, Lisp_Object exponent)
195{ 195{
196 CHECK_FIXNUM (exponent); 196 CHECK_FIXNUM (exponent);
197 int e = min (max (INT_MIN, XINT (exponent)), INT_MAX); 197 int e = min (max (INT_MIN, XFIXNUM (exponent)), INT_MAX);
198 return make_float (ldexp (extract_float (sgnfcand), e)); 198 return make_float (ldexp (extract_float (sgnfcand), e));
199} 199}
200 200
@@ -215,14 +215,14 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
215 CHECK_FIXNUM_OR_FLOAT (arg2); 215 CHECK_FIXNUM_OR_FLOAT (arg2);
216 if (FIXNUMP (arg1) /* common lisp spec */ 216 if (FIXNUMP (arg1) /* common lisp spec */
217 && FIXNUMP (arg2) /* don't promote, if both are ints, and */ 217 && FIXNUMP (arg2) /* don't promote, if both are ints, and */
218 && XINT (arg2) >= 0) /* we are sure the result is not fractional */ 218 && XFIXNUM (arg2) >= 0) /* we are sure the result is not fractional */
219 { /* this can be improved by pre-calculating */ 219 { /* this can be improved by pre-calculating */
220 EMACS_INT y; /* some binary powers of x then accumulating */ 220 EMACS_INT y; /* some binary powers of x then accumulating */
221 EMACS_UINT acc, x; /* Unsigned so that overflow is well defined. */ 221 EMACS_UINT acc, x; /* Unsigned so that overflow is well defined. */
222 Lisp_Object val; 222 Lisp_Object val;
223 223
224 x = XINT (arg1); 224 x = XFIXNUM (arg1);
225 y = XINT (arg2); 225 y = XFIXNUM (arg2);
226 acc = (y & 1 ? x : 1); 226 acc = (y & 1 ? x : 1);
227 227
228 while ((y >>= 1) != 0) 228 while ((y >>= 1) != 0)
@@ -285,7 +285,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
285 arg = make_number (val); 285 arg = make_number (val);
286 mpz_clear (val); 286 mpz_clear (val);
287 } 287 }
288 else if (FIXNUMP (arg) && XINT (arg) == MOST_NEGATIVE_FIXNUM) 288 else if (FIXNUMP (arg) && XFIXNUM (arg) == MOST_NEGATIVE_FIXNUM)
289 { 289 {
290 mpz_t val; 290 mpz_t val;
291 mpz_init (val); 291 mpz_init (val);
@@ -295,8 +295,8 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
295 } 295 }
296 else if (FLOATP (arg)) 296 else if (FLOATP (arg))
297 arg = make_float (fabs (XFLOAT_DATA (arg))); 297 arg = make_float (fabs (XFLOAT_DATA (arg)));
298 else if (XINT (arg) < 0) 298 else if (XFIXNUM (arg) < 0)
299 XSETINT (arg, - XINT (arg)); 299 XSETINT (arg, - XFIXNUM (arg));
300 300
301 return arg; 301 return arg;
302} 302}
@@ -310,7 +310,7 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
310 if (BIGNUMP (arg)) 310 if (BIGNUMP (arg))
311 return make_float (mpz_get_d (XBIGNUM (arg)->value)); 311 return make_float (mpz_get_d (XBIGNUM (arg)->value));
312 if (FIXNUMP (arg)) 312 if (FIXNUMP (arg))
313 return make_float ((double) XINT (arg)); 313 return make_float ((double) XFIXNUM (arg));
314 else /* give 'em the same float back */ 314 else /* give 'em the same float back */
315 return arg; 315 return arg;
316} 316}
@@ -351,7 +351,7 @@ This is the same as the exponent of a float. */)
351 else 351 else
352 { 352 {
353 eassert (FIXNUMP (arg)); 353 eassert (FIXNUMP (arg));
354 EMACS_INT i = eabs (XINT (arg)); 354 EMACS_INT i = eabs (XFIXNUM (arg));
355 value = (i == 0 355 value = (i == 0
356 ? MOST_NEGATIVE_FIXNUM 356 ? MOST_NEGATIVE_FIXNUM
357 : EMACS_UINT_WIDTH - 1 - ecount_leading_zeros (i)); 357 : EMACS_UINT_WIDTH - 1 - ecount_leading_zeros (i));
@@ -383,13 +383,13 @@ rounding_driver (Lisp_Object arg, Lisp_Object divisor,
383 CHECK_FIXNUM_OR_FLOAT (divisor); 383 CHECK_FIXNUM_OR_FLOAT (divisor);
384 if (!FLOATP (arg) && !FLOATP (divisor)) 384 if (!FLOATP (arg) && !FLOATP (divisor))
385 { 385 {
386 if (XINT (divisor) == 0) 386 if (XFIXNUM (divisor) == 0)
387 xsignal0 (Qarith_error); 387 xsignal0 (Qarith_error);
388 return make_fixnum (int_round2 (XINT (arg), XINT (divisor))); 388 return make_fixnum (int_round2 (XFIXNUM (arg), XFIXNUM (divisor)));
389 } 389 }
390 390
391 double f1 = FLOATP (arg) ? XFLOAT_DATA (arg) : XINT (arg); 391 double f1 = FLOATP (arg) ? XFLOAT_DATA (arg) : XFIXNUM (arg);
392 double f2 = FLOATP (divisor) ? XFLOAT_DATA (divisor) : XINT (divisor); 392 double f2 = FLOATP (divisor) ? XFLOAT_DATA (divisor) : XFIXNUM (divisor);
393 if (! IEEE_FLOATING_POINT && f2 == 0) 393 if (! IEEE_FLOATING_POINT && f2 == 0)
394 xsignal0 (Qarith_error); 394 xsignal0 (Qarith_error);
395 d = f1 / f2; 395 d = f1 / f2;
@@ -510,8 +510,8 @@ fmod_float (Lisp_Object x, Lisp_Object y)
510{ 510{
511 double f1, f2; 511 double f1, f2;
512 512
513 f1 = FLOATP (x) ? XFLOAT_DATA (x) : XINT (x); 513 f1 = FLOATP (x) ? XFLOAT_DATA (x) : XFIXNUM (x);
514 f2 = FLOATP (y) ? XFLOAT_DATA (y) : XINT (y); 514 f2 = FLOATP (y) ? XFLOAT_DATA (y) : XFIXNUM (y);
515 515
516 f1 = fmod (f1, f2); 516 f1 = fmod (f1, f2);
517 517