aboutsummaryrefslogtreecommitdiffstats
path: root/src/floatfns.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-08 14:25:08 -0700
committerDan Nicolaescu2010-07-08 14:25:08 -0700
commit5842a27bbfb7efa6872824e501bc7ec98b631553 (patch)
treed173899af9cbed9d90d94cfc710e6ecc06dd1f6b /src/floatfns.c
parent71c44c04bb996abe77db8efd88255fde06532b10 (diff)
downloademacs-5842a27bbfb7efa6872824e501bc7ec98b631553.tar.gz
emacs-5842a27bbfb7efa6872824e501bc7ec98b631553.zip
Convert DEFUNs to standard C.
* src/alloc.c: Convert DEFUNs to standard C. * src/buffer.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/dosfns.c: * src/editfns.c: * src/emacs.c: * src/eval.c: * src/fileio.c: * src/filelock.c: * src/floatfns.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/image.c: * src/indent.c: * src/insdel.c: * src/keyboard.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/menu.c: * src/minibuf.c: * src/msdos.c: * src/nsfns.m: * src/nsmenu.m: * src/nsselect.m: * src/print.c: * src/process.c: * src/search.c: * src/sound.c: * src/syntax.c: * src/term.c: * src/terminal.c: * src/textprop.c: * src/undo.c: * src/w16select.c: * src/w32console.c: * src/w32fns.c: * src/w32font.c: * src/w32menu.c: * src/w32proc.c: * src/w32select.c: * src/window.c: * src/xdisp.c: * src/xfaces.c: * src/xfns.c: * src/xmenu.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: Likewise.
Diffstat (limited to 'src/floatfns.c')
-rw-r--r--src/floatfns.c126
1 files changed, 42 insertions, 84 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index 96a89337c75..64dc308c7dd 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -206,8 +206,7 @@ extract_float (num)
206 206
207DEFUN ("acos", Facos, Sacos, 1, 1, 0, 207DEFUN ("acos", Facos, Sacos, 1, 1, 0,
208 doc: /* Return the inverse cosine of ARG. */) 208 doc: /* Return the inverse cosine of ARG. */)
209 (arg) 209 (register Lisp_Object arg)
210 register Lisp_Object arg;
211{ 210{
212 double d = extract_float (arg); 211 double d = extract_float (arg);
213#ifdef FLOAT_CHECK_DOMAIN 212#ifdef FLOAT_CHECK_DOMAIN
@@ -220,8 +219,7 @@ DEFUN ("acos", Facos, Sacos, 1, 1, 0,
220 219
221DEFUN ("asin", Fasin, Sasin, 1, 1, 0, 220DEFUN ("asin", Fasin, Sasin, 1, 1, 0,
222 doc: /* Return the inverse sine of ARG. */) 221 doc: /* Return the inverse sine of ARG. */)
223 (arg) 222 (register Lisp_Object arg)
224 register Lisp_Object arg;
225{ 223{
226 double d = extract_float (arg); 224 double d = extract_float (arg);
227#ifdef FLOAT_CHECK_DOMAIN 225#ifdef FLOAT_CHECK_DOMAIN
@@ -238,8 +236,7 @@ If only one argument Y is given, return the inverse tangent of Y.
238If two arguments Y and X are given, return the inverse tangent of Y 236If two arguments Y and X are given, return the inverse tangent of Y
239divided by X, i.e. the angle in radians between the vector (X, Y) 237divided by X, i.e. the angle in radians between the vector (X, Y)
240and the x-axis. */) 238and the x-axis. */)
241 (y, x) 239 (register Lisp_Object y, Lisp_Object x)
242 register Lisp_Object y, x;
243{ 240{
244 double d = extract_float (y); 241 double d = extract_float (y);
245 242
@@ -256,8 +253,7 @@ and the x-axis. */)
256 253
257DEFUN ("cos", Fcos, Scos, 1, 1, 0, 254DEFUN ("cos", Fcos, Scos, 1, 1, 0,
258 doc: /* Return the cosine of ARG. */) 255 doc: /* Return the cosine of ARG. */)
259 (arg) 256 (register Lisp_Object arg)
260 register Lisp_Object arg;
261{ 257{
262 double d = extract_float (arg); 258 double d = extract_float (arg);
263 IN_FLOAT (d = cos (d), "cos", arg); 259 IN_FLOAT (d = cos (d), "cos", arg);
@@ -266,8 +262,7 @@ DEFUN ("cos", Fcos, Scos, 1, 1, 0,
266 262
267DEFUN ("sin", Fsin, Ssin, 1, 1, 0, 263DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
268 doc: /* Return the sine of ARG. */) 264 doc: /* Return the sine of ARG. */)
269 (arg) 265 (register Lisp_Object arg)
270 register Lisp_Object arg;
271{ 266{
272 double d = extract_float (arg); 267 double d = extract_float (arg);
273 IN_FLOAT (d = sin (d), "sin", arg); 268 IN_FLOAT (d = sin (d), "sin", arg);
@@ -276,8 +271,7 @@ DEFUN ("sin", Fsin, Ssin, 1, 1, 0,
276 271
277DEFUN ("tan", Ftan, Stan, 1, 1, 0, 272DEFUN ("tan", Ftan, Stan, 1, 1, 0,
278 doc: /* Return the tangent of ARG. */) 273 doc: /* Return the tangent of ARG. */)
279 (arg) 274 (register Lisp_Object arg)
280 register Lisp_Object arg;
281{ 275{
282 double d = extract_float (arg); 276 double d = extract_float (arg);
283 double c = cos (d); 277 double c = cos (d);
@@ -292,8 +286,7 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0,
292#if defined HAVE_ISNAN && defined HAVE_COPYSIGN 286#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
293DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, 287DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
294 doc: /* Return non nil iff argument X is a NaN. */) 288 doc: /* Return non nil iff argument X is a NaN. */)
295 (x) 289 (Lisp_Object x)
296 Lisp_Object x;
297{ 290{
298 CHECK_FLOAT (x); 291 CHECK_FLOAT (x);
299 return isnan (XFLOAT_DATA (x)) ? Qt : Qnil; 292 return isnan (XFLOAT_DATA (x)) ? Qt : Qnil;
@@ -302,8 +295,7 @@ DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
302DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0, 295DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0,
303 doc: /* Copy sign of X2 to value of X1, and return the result. 296 doc: /* Copy sign of X2 to value of X1, and return the result.
304Cause an error if X1 or X2 is not a float. */) 297Cause an error if X1 or X2 is not a float. */)
305 (x1, x2) 298 (Lisp_Object x1, Lisp_Object x2)
306 Lisp_Object x1, x2;
307{ 299{
308 double f1, f2; 300 double f1, f2;
309 301
@@ -326,8 +318,7 @@ and an integral exponent EXP for 2, such that:
326 318
327The function returns the cons cell (SGNFCAND . EXP). 319The function returns the cons cell (SGNFCAND . EXP).
328If X is zero, both parts (SGNFCAND and EXP) are zero. */) 320If X is zero, both parts (SGNFCAND and EXP) are zero. */)
329 (x) 321 (Lisp_Object x)
330 Lisp_Object x;
331{ 322{
332 double f = XFLOATINT (x); 323 double f = XFLOATINT (x);
333 324
@@ -345,8 +336,7 @@ DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
345 doc: /* Construct number X from significand SGNFCAND and exponent EXP. 336 doc: /* Construct number X from significand SGNFCAND and exponent EXP.
346Returns the floating point value resulting from multiplying SGNFCAND 337Returns the floating point value resulting from multiplying SGNFCAND
347(the significand) by 2 raised to the power of EXP (the exponent). */) 338(the significand) by 2 raised to the power of EXP (the exponent). */)
348 (sgnfcand, exp) 339 (Lisp_Object sgnfcand, Lisp_Object exp)
349 Lisp_Object sgnfcand, exp;
350{ 340{
351 CHECK_NUMBER (exp); 341 CHECK_NUMBER (exp);
352 return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp))); 342 return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp)));
@@ -357,8 +347,7 @@ Returns the floating point value resulting from multiplying SGNFCAND
357 347
358DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0, 348DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0,
359 doc: /* Return the bessel function j0 of ARG. */) 349 doc: /* Return the bessel function j0 of ARG. */)
360 (arg) 350 (register Lisp_Object arg)
361 register Lisp_Object arg;
362{ 351{
363 double d = extract_float (arg); 352 double d = extract_float (arg);
364 IN_FLOAT (d = j0 (d), "bessel-j0", arg); 353 IN_FLOAT (d = j0 (d), "bessel-j0", arg);
@@ -367,8 +356,7 @@ DEFUN ("bessel-j0", Fbessel_j0, Sbessel_j0, 1, 1, 0,
367 356
368DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0, 357DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0,
369 doc: /* Return the bessel function j1 of ARG. */) 358 doc: /* Return the bessel function j1 of ARG. */)
370 (arg) 359 (register Lisp_Object arg)
371 register Lisp_Object arg;
372{ 360{
373 double d = extract_float (arg); 361 double d = extract_float (arg);
374 IN_FLOAT (d = j1 (d), "bessel-j1", arg); 362 IN_FLOAT (d = j1 (d), "bessel-j1", arg);
@@ -378,8 +366,7 @@ DEFUN ("bessel-j1", Fbessel_j1, Sbessel_j1, 1, 1, 0,
378DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0, 366DEFUN ("bessel-jn", Fbessel_jn, Sbessel_jn, 2, 2, 0,
379 doc: /* Return the order N bessel function output jn of ARG. 367 doc: /* Return the order N bessel function output jn of ARG.
380The first arg (the order) is truncated to an integer. */) 368The first arg (the order) is truncated to an integer. */)
381 (n, arg) 369 (register Lisp_Object n, Lisp_Object arg)
382 register Lisp_Object n, arg;
383{ 370{
384 int i1 = extract_float (n); 371 int i1 = extract_float (n);
385 double f2 = extract_float (arg); 372 double f2 = extract_float (arg);
@@ -390,8 +377,7 @@ The first arg (the order) is truncated to an integer. */)
390 377
391DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0, 378DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0,
392 doc: /* Return the bessel function y0 of ARG. */) 379 doc: /* Return the bessel function y0 of ARG. */)
393 (arg) 380 (register Lisp_Object arg)
394 register Lisp_Object arg;
395{ 381{
396 double d = extract_float (arg); 382 double d = extract_float (arg);
397 IN_FLOAT (d = y0 (d), "bessel-y0", arg); 383 IN_FLOAT (d = y0 (d), "bessel-y0", arg);
@@ -400,8 +386,7 @@ DEFUN ("bessel-y0", Fbessel_y0, Sbessel_y0, 1, 1, 0,
400 386
401DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0, 387DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0,
402 doc: /* Return the bessel function y1 of ARG. */) 388 doc: /* Return the bessel function y1 of ARG. */)
403 (arg) 389 (register Lisp_Object arg)
404 register Lisp_Object arg;
405{ 390{
406 double d = extract_float (arg); 391 double d = extract_float (arg);
407 IN_FLOAT (d = y1 (d), "bessel-y0", arg); 392 IN_FLOAT (d = y1 (d), "bessel-y0", arg);
@@ -411,8 +396,7 @@ DEFUN ("bessel-y1", Fbessel_y1, Sbessel_y1, 1, 1, 0,
411DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0, 396DEFUN ("bessel-yn", Fbessel_yn, Sbessel_yn, 2, 2, 0,
412 doc: /* Return the order N bessel function output yn of ARG. 397 doc: /* Return the order N bessel function output yn of ARG.
413The first arg (the order) is truncated to an integer. */) 398The first arg (the order) is truncated to an integer. */)
414 (n, arg) 399 (register Lisp_Object n, Lisp_Object arg)
415 register Lisp_Object n, arg;
416{ 400{
417 int i1 = extract_float (n); 401 int i1 = extract_float (n);
418 double f2 = extract_float (arg); 402 double f2 = extract_float (arg);
@@ -427,8 +411,7 @@ The first arg (the order) is truncated to an integer. */)
427 411
428DEFUN ("erf", Ferf, Serf, 1, 1, 0, 412DEFUN ("erf", Ferf, Serf, 1, 1, 0,
429 doc: /* Return the mathematical error function of ARG. */) 413 doc: /* Return the mathematical error function of ARG. */)
430 (arg) 414 (register Lisp_Object arg)
431 register Lisp_Object arg;
432{ 415{
433 double d = extract_float (arg); 416 double d = extract_float (arg);
434 IN_FLOAT (d = erf (d), "erf", arg); 417 IN_FLOAT (d = erf (d), "erf", arg);
@@ -437,8 +420,7 @@ DEFUN ("erf", Ferf, Serf, 1, 1, 0,
437 420
438DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0, 421DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0,
439 doc: /* Return the complementary error function of ARG. */) 422 doc: /* Return the complementary error function of ARG. */)
440 (arg) 423 (register Lisp_Object arg)
441 register Lisp_Object arg;
442{ 424{
443 double d = extract_float (arg); 425 double d = extract_float (arg);
444 IN_FLOAT (d = erfc (d), "erfc", arg); 426 IN_FLOAT (d = erfc (d), "erfc", arg);
@@ -447,8 +429,7 @@ DEFUN ("erfc", Ferfc, Serfc, 1, 1, 0,
447 429
448DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0, 430DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0,
449 doc: /* Return the log gamma of ARG. */) 431 doc: /* Return the log gamma of ARG. */)
450 (arg) 432 (register Lisp_Object arg)
451 register Lisp_Object arg;
452{ 433{
453 double d = extract_float (arg); 434 double d = extract_float (arg);
454 IN_FLOAT (d = lgamma (d), "log-gamma", arg); 435 IN_FLOAT (d = lgamma (d), "log-gamma", arg);
@@ -457,8 +438,7 @@ DEFUN ("log-gamma", Flog_gamma, Slog_gamma, 1, 1, 0,
457 438
458DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0, 439DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0,
459 doc: /* Return the cube root of ARG. */) 440 doc: /* Return the cube root of ARG. */)
460 (arg) 441 (register Lisp_Object arg)
461 register Lisp_Object arg;
462{ 442{
463 double d = extract_float (arg); 443 double d = extract_float (arg);
464#ifdef HAVE_CBRT 444#ifdef HAVE_CBRT
@@ -476,8 +456,7 @@ DEFUN ("cube-root", Fcube_root, Scube_root, 1, 1, 0,
476 456
477DEFUN ("exp", Fexp, Sexp, 1, 1, 0, 457DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
478 doc: /* Return the exponential base e of ARG. */) 458 doc: /* Return the exponential base e of ARG. */)
479 (arg) 459 (register Lisp_Object arg)
480 register Lisp_Object arg;
481{ 460{
482 double d = extract_float (arg); 461 double d = extract_float (arg);
483#ifdef FLOAT_CHECK_DOMAIN 462#ifdef FLOAT_CHECK_DOMAIN
@@ -493,8 +472,7 @@ DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
493 472
494DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0, 473DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
495 doc: /* Return the exponential ARG1 ** ARG2. */) 474 doc: /* Return the exponential ARG1 ** ARG2. */)
496 (arg1, arg2) 475 (register Lisp_Object arg1, Lisp_Object arg2)
497 register Lisp_Object arg1, arg2;
498{ 476{
499 double f1, f2, f3; 477 double f1, f2, f3;
500 478
@@ -552,8 +530,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
552DEFUN ("log", Flog, Slog, 1, 2, 0, 530DEFUN ("log", Flog, Slog, 1, 2, 0,
553 doc: /* Return the natural logarithm of ARG. 531 doc: /* Return the natural logarithm of ARG.
554If the optional argument BASE is given, return log ARG using that base. */) 532If the optional argument BASE is given, return log ARG using that base. */)
555 (arg, base) 533 (register Lisp_Object arg, Lisp_Object base)
556 register Lisp_Object arg, base;
557{ 534{
558 double d = extract_float (arg); 535 double d = extract_float (arg);
559 536
@@ -581,8 +558,7 @@ If the optional argument BASE is given, return log ARG using that base. */)
581 558
582DEFUN ("log10", Flog10, Slog10, 1, 1, 0, 559DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
583 doc: /* Return the logarithm base 10 of ARG. */) 560 doc: /* Return the logarithm base 10 of ARG. */)
584 (arg) 561 (register Lisp_Object arg)
585 register Lisp_Object arg;
586{ 562{
587 double d = extract_float (arg); 563 double d = extract_float (arg);
588#ifdef FLOAT_CHECK_DOMAIN 564#ifdef FLOAT_CHECK_DOMAIN
@@ -595,8 +571,7 @@ DEFUN ("log10", Flog10, Slog10, 1, 1, 0,
595 571
596DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0, 572DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
597 doc: /* Return the square root of ARG. */) 573 doc: /* Return the square root of ARG. */)
598 (arg) 574 (register Lisp_Object arg)
599 register Lisp_Object arg;
600{ 575{
601 double d = extract_float (arg); 576 double d = extract_float (arg);
602#ifdef FLOAT_CHECK_DOMAIN 577#ifdef FLOAT_CHECK_DOMAIN
@@ -611,8 +586,7 @@ DEFUN ("sqrt", Fsqrt, Ssqrt, 1, 1, 0,
611 586
612DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0, 587DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0,
613 doc: /* Return the inverse hyperbolic cosine of ARG. */) 588 doc: /* Return the inverse hyperbolic cosine of ARG. */)
614 (arg) 589 (register Lisp_Object arg)
615 register Lisp_Object arg;
616{ 590{
617 double d = extract_float (arg); 591 double d = extract_float (arg);
618#ifdef FLOAT_CHECK_DOMAIN 592#ifdef FLOAT_CHECK_DOMAIN
@@ -629,8 +603,7 @@ DEFUN ("acosh", Facosh, Sacosh, 1, 1, 0,
629 603
630DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0, 604DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0,
631 doc: /* Return the inverse hyperbolic sine of ARG. */) 605 doc: /* Return the inverse hyperbolic sine of ARG. */)
632 (arg) 606 (register Lisp_Object arg)
633 register Lisp_Object arg;
634{ 607{
635 double d = extract_float (arg); 608 double d = extract_float (arg);
636#ifdef HAVE_INVERSE_HYPERBOLIC 609#ifdef HAVE_INVERSE_HYPERBOLIC
@@ -643,8 +616,7 @@ DEFUN ("asinh", Fasinh, Sasinh, 1, 1, 0,
643 616
644DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0, 617DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0,
645 doc: /* Return the inverse hyperbolic tangent of ARG. */) 618 doc: /* Return the inverse hyperbolic tangent of ARG. */)
646 (arg) 619 (register Lisp_Object arg)
647 register Lisp_Object arg;
648{ 620{
649 double d = extract_float (arg); 621 double d = extract_float (arg);
650#ifdef FLOAT_CHECK_DOMAIN 622#ifdef FLOAT_CHECK_DOMAIN
@@ -661,8 +633,7 @@ DEFUN ("atanh", Fatanh, Satanh, 1, 1, 0,
661 633
662DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0, 634DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0,
663 doc: /* Return the hyperbolic cosine of ARG. */) 635 doc: /* Return the hyperbolic cosine of ARG. */)
664 (arg) 636 (register Lisp_Object arg)
665 register Lisp_Object arg;
666{ 637{
667 double d = extract_float (arg); 638 double d = extract_float (arg);
668#ifdef FLOAT_CHECK_DOMAIN 639#ifdef FLOAT_CHECK_DOMAIN
@@ -675,8 +646,7 @@ DEFUN ("cosh", Fcosh, Scosh, 1, 1, 0,
675 646
676DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0, 647DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0,
677 doc: /* Return the hyperbolic sine of ARG. */) 648 doc: /* Return the hyperbolic sine of ARG. */)
678 (arg) 649 (register Lisp_Object arg)
679 register Lisp_Object arg;
680{ 650{
681 double d = extract_float (arg); 651 double d = extract_float (arg);
682#ifdef FLOAT_CHECK_DOMAIN 652#ifdef FLOAT_CHECK_DOMAIN
@@ -689,8 +659,7 @@ DEFUN ("sinh", Fsinh, Ssinh, 1, 1, 0,
689 659
690DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0, 660DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0,
691 doc: /* Return the hyperbolic tangent of ARG. */) 661 doc: /* Return the hyperbolic tangent of ARG. */)
692 (arg) 662 (register Lisp_Object arg)
693 register Lisp_Object arg;
694{ 663{
695 double d = extract_float (arg); 664 double d = extract_float (arg);
696 IN_FLOAT (d = tanh (d), "tanh", arg); 665 IN_FLOAT (d = tanh (d), "tanh", arg);
@@ -700,8 +669,7 @@ DEFUN ("tanh", Ftanh, Stanh, 1, 1, 0,
700 669
701DEFUN ("abs", Fabs, Sabs, 1, 1, 0, 670DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
702 doc: /* Return the absolute value of ARG. */) 671 doc: /* Return the absolute value of ARG. */)
703 (arg) 672 (register Lisp_Object arg)
704 register Lisp_Object arg;
705{ 673{
706 CHECK_NUMBER_OR_FLOAT (arg); 674 CHECK_NUMBER_OR_FLOAT (arg);
707 675
@@ -715,8 +683,7 @@ DEFUN ("abs", Fabs, Sabs, 1, 1, 0,
715 683
716DEFUN ("float", Ffloat, Sfloat, 1, 1, 0, 684DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
717 doc: /* Return the floating point number equal to ARG. */) 685 doc: /* Return the floating point number equal to ARG. */)
718 (arg) 686 (register Lisp_Object arg)
719 register Lisp_Object arg;
720{ 687{
721 CHECK_NUMBER_OR_FLOAT (arg); 688 CHECK_NUMBER_OR_FLOAT (arg);
722 689
@@ -729,8 +696,7 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
729DEFUN ("logb", Flogb, Slogb, 1, 1, 0, 696DEFUN ("logb", Flogb, Slogb, 1, 1, 0,
730 doc: /* Returns largest integer <= the base 2 log of the magnitude of ARG. 697 doc: /* Returns largest integer <= the base 2 log of the magnitude of ARG.
731This is the same as the exponent of a float. */) 698This is the same as the exponent of a float. */)
732 (arg) 699 (Lisp_Object arg)
733 Lisp_Object arg;
734{ 700{
735 Lisp_Object val; 701 Lisp_Object val;
736 EMACS_INT value; 702 EMACS_INT value;
@@ -891,8 +857,7 @@ DEFUN ("ceiling", Fceiling, Sceiling, 1, 2, 0,
891 doc: /* Return the smallest integer no less than ARG. 857 doc: /* Return the smallest integer no less than ARG.
892This rounds the value towards +inf. 858This rounds the value towards +inf.
893With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */) 859With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */)
894 (arg, divisor) 860 (Lisp_Object arg, Lisp_Object divisor)
895 Lisp_Object arg, divisor;
896{ 861{
897 return rounding_driver (arg, divisor, ceil, ceiling2, "ceiling"); 862 return rounding_driver (arg, divisor, ceil, ceiling2, "ceiling");
898} 863}
@@ -901,8 +866,7 @@ DEFUN ("floor", Ffloor, Sfloor, 1, 2, 0,
901 doc: /* Return the largest integer no greater than ARG. 866 doc: /* Return the largest integer no greater than ARG.
902This rounds the value towards -inf. 867This rounds the value towards -inf.
903With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */) 868With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */)
904 (arg, divisor) 869 (Lisp_Object arg, Lisp_Object divisor)
905 Lisp_Object arg, divisor;
906{ 870{
907 return rounding_driver (arg, divisor, floor, floor2, "floor"); 871 return rounding_driver (arg, divisor, floor, floor2, "floor");
908} 872}
@@ -915,8 +879,7 @@ Rounding a value equidistant between two integers may choose the
915integer closer to zero, or it may prefer an even integer, depending on 879integer closer to zero, or it may prefer an even integer, depending on
916your machine. For example, \(round 2.5\) can return 3 on some 880your machine. For example, \(round 2.5\) can return 3 on some
917systems, but 2 on others. */) 881systems, but 2 on others. */)
918 (arg, divisor) 882 (Lisp_Object arg, Lisp_Object divisor)
919 Lisp_Object arg, divisor;
920{ 883{
921 return rounding_driver (arg, divisor, emacs_rint, round2, "round"); 884 return rounding_driver (arg, divisor, emacs_rint, round2, "round");
922} 885}
@@ -925,8 +888,7 @@ DEFUN ("truncate", Ftruncate, Struncate, 1, 2, 0,
925 doc: /* Truncate a floating point number to an int. 888 doc: /* Truncate a floating point number to an int.
926Rounds ARG toward zero. 889Rounds ARG toward zero.
927With optional DIVISOR, truncate ARG/DIVISOR. */) 890With optional DIVISOR, truncate ARG/DIVISOR. */)
928 (arg, divisor) 891 (Lisp_Object arg, Lisp_Object divisor)
929 Lisp_Object arg, divisor;
930{ 892{
931 return rounding_driver (arg, divisor, double_identity, truncate2, 893 return rounding_driver (arg, divisor, double_identity, truncate2,
932 "truncate"); 894 "truncate");
@@ -956,8 +918,7 @@ fmod_float (Lisp_Object x, Lisp_Object y)
956DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0, 918DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
957 doc: /* Return the smallest integer no less than ARG, as a float. 919 doc: /* Return the smallest integer no less than ARG, as a float.
958\(Round toward +inf.\) */) 920\(Round toward +inf.\) */)
959 (arg) 921 (register Lisp_Object arg)
960 register Lisp_Object arg;
961{ 922{
962 double d = extract_float (arg); 923 double d = extract_float (arg);
963 IN_FLOAT (d = ceil (d), "fceiling", arg); 924 IN_FLOAT (d = ceil (d), "fceiling", arg);
@@ -967,8 +928,7 @@ DEFUN ("fceiling", Ffceiling, Sfceiling, 1, 1, 0,
967DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0, 928DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
968 doc: /* Return the largest integer no greater than ARG, as a float. 929 doc: /* Return the largest integer no greater than ARG, as a float.
969\(Round towards -inf.\) */) 930\(Round towards -inf.\) */)
970 (arg) 931 (register Lisp_Object arg)
971 register Lisp_Object arg;
972{ 932{
973 double d = extract_float (arg); 933 double d = extract_float (arg);
974 IN_FLOAT (d = floor (d), "ffloor", arg); 934 IN_FLOAT (d = floor (d), "ffloor", arg);
@@ -977,8 +937,7 @@ DEFUN ("ffloor", Fffloor, Sffloor, 1, 1, 0,
977 937
978DEFUN ("fround", Ffround, Sfround, 1, 1, 0, 938DEFUN ("fround", Ffround, Sfround, 1, 1, 0,
979 doc: /* Return the nearest integer to ARG, as a float. */) 939 doc: /* Return the nearest integer to ARG, as a float. */)
980 (arg) 940 (register Lisp_Object arg)
981 register Lisp_Object arg;
982{ 941{
983 double d = extract_float (arg); 942 double d = extract_float (arg);
984 IN_FLOAT (d = emacs_rint (d), "fround", arg); 943 IN_FLOAT (d = emacs_rint (d), "fround", arg);
@@ -988,8 +947,7 @@ DEFUN ("fround", Ffround, Sfround, 1, 1, 0,
988DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0, 947DEFUN ("ftruncate", Fftruncate, Sftruncate, 1, 1, 0,
989 doc: /* Truncate a floating point number to an integral float value. 948 doc: /* Truncate a floating point number to an integral float value.
990Rounds the value toward zero. */) 949Rounds the value toward zero. */)
991 (arg) 950 (register Lisp_Object arg)
992 register Lisp_Object arg;
993{ 951{
994 double d = extract_float (arg); 952 double d = extract_float (arg);
995 if (d >= 0.0) 953 if (d >= 0.0)