diff src/floatfns.c @ 5252:378a34562cbe

Fix style, documentation for rounding functions and multiple values. src/ChangeLog addition: 2010-08-30 Aidan Kehoe <kehoea@parhasard.net> * floatfns.c (ceiling_one_mundane_arg, floor_one_mundane_arg) (round_one_mundane_arg, truncate_one_mundane_arg): INTEGERP is always available, no need to wrap calls to it with #ifdef HAVE_BIGNUM. (Fceiling, Ffloor, Fround, Ftruncate, Ffceiling, Fffloor) (Ffround, Fftruncate): Correct some code formatting here. * doprnt.c (emacs_doprnt_1): Remove some needless #ifdef WITH_NUMBER_TYPES, now number.h is always #included. man/ChangeLog addition: 2010-08-30 Aidan Kehoe <kehoea@parhasard.net> * lispref/eval.texi (Evaluation, Multiple values): Document our implementation of multiple values; point the reader to the CLTL or the Hyperspec for details of exactly when values are discarded. * lispref/numbers.texi (Numeric Conversions): Document the optional DIVISOR arguments to the rounding functions, and document that they all return multiple values. (Rounding Operations): Ditto. * cl.texi (Multiple Values): Document that we've moved the multiple values implementation to core code, and cross-reference to the Lispref. (Numerical Functions): The various rounding functions are now identical to the built-in rounding functions, with the exception that they return lists, not multiple values; document this.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 30 Aug 2010 15:23:42 +0100
parents 71ee43b8a74d
children 2a7b6ddb8063 308d34e9f07d
line wrap: on
line diff
--- a/src/floatfns.c	Mon Aug 30 15:21:04 2010 +0100
+++ b/src/floatfns.c	Mon Aug 30 15:23:42 2010 +0100
@@ -1300,11 +1300,7 @@
     }
   else
     {
-#ifdef HAVE_BIGNUM
       if (INTEGERP (number))
-#else
-      if (INTP (number))
-#endif
 	{
 	  return values2 (number, Qzero);
 	}
@@ -1566,11 +1562,7 @@
 floor_one_mundane_arg (Lisp_Object number, Lisp_Object divisor,
 		       int return_float)
 {
-#ifdef HAVE_BIGNUM
   if (INTEGERP (number))
-#else
-  if (INTP (number))
-#endif
     {
       if (return_float)
 	{
@@ -1971,11 +1963,7 @@
 round_one_mundane_arg (Lisp_Object number, Lisp_Object divisor,
 		       int return_float)
 {
-#ifdef HAVE_BIGNUM
   if (INTEGERP (number))
-#else
-  if (INTP (number))
-#endif
     {
       if (return_float)
 	{
@@ -2258,11 +2246,7 @@
 truncate_one_mundane_arg (Lisp_Object number, Lisp_Object divisor,
 			  int return_float)
 {
-#ifdef HAVE_BIGNUM
   if (INTEGERP (number))
-#else
-  if (INTP (number))
-#endif
     {
       if (return_float)
 	{
@@ -2301,7 +2285,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(ceiling, 0);
+  ROUNDING_CONVERT (ceiling, 0);
 }
 
 DEFUN ("floor", Ffloor, 1, 2, 0, /*
@@ -2316,7 +2300,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(floor, 0);
+  ROUNDING_CONVERT (floor, 0);
 }
 
 DEFUN ("round", Fround, 1, 2, 0, /*
@@ -2333,7 +2317,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(round, 0);
+  ROUNDING_CONVERT (round, 0);
 }
 
 DEFUN ("truncate", Ftruncate, 1, 2, 0, /*
@@ -2347,7 +2331,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(truncate, 0);
+  ROUNDING_CONVERT (truncate, 0);
 }
 
 /* Float-rounding functions. */
@@ -2364,7 +2348,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(ceiling, 1);
+  ROUNDING_CONVERT (ceiling, 1);
 }
 
 DEFUN ("ffloor", Fffloor, 1, 2, 0, /*
@@ -2379,7 +2363,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(floor, 1);
+  ROUNDING_CONVERT (floor, 1);
 }
 
 DEFUN ("fround", Ffround, 1, 2, 0, /*
@@ -2395,7 +2379,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(round, 1);
+  ROUNDING_CONVERT (round, 1);
 }
 
 DEFUN ("ftruncate", Fftruncate, 1, 2, 0, /*
@@ -2410,7 +2394,7 @@
 */
        (number, divisor))
 {
-  ROUNDING_CONVERT(truncate, 1);
+  ROUNDING_CONVERT (truncate, 1);
 }
 
 #ifdef FLOAT_CATCH_SIGILL