aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorAndreas Schwab2017-03-08 09:25:09 +0100
committerAndreas Schwab2017-03-08 09:37:11 +0100
commitb82df00445725211d868a67cae1869d2f95270b6 (patch)
tree5f6b05e9bf3ea923700770cb7a12d12770affc46 /src/data.c
parent45541e4611b1ec4cd727f26dac27705b4a468bfc (diff)
downloademacs-b82df00445725211d868a67cae1869d2f95270b6.tar.gz
emacs-b82df00445725211d868a67cae1869d2f95270b6.zip
* data.c (minmax_driver): Use CHECK_NUMBER_OR_FLOAT_COERCE_MARKER.
(Fmax, Fmin): Restore documentation.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index b3234a79b88..997a41b6d05 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2969,16 +2969,18 @@ minmax_driver (ptrdiff_t nargs, Lisp_Object *args,
2969 for (ptrdiff_t argnum = 0; argnum < nargs; argnum++) 2969 for (ptrdiff_t argnum = 0; argnum < nargs; argnum++)
2970 { 2970 {
2971 Lisp_Object val = args[argnum]; 2971 Lisp_Object val = args[argnum];
2972 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val);
2972 if (argnum == 0 || !NILP (arithcompare (val, accum, comparison))) 2973 if (argnum == 0 || !NILP (arithcompare (val, accum, comparison)))
2973 accum = val; 2974 accum = val;
2974 else if (FLOATP (accum) && isnan (XFLOAT_DATA (accum))) 2975 else if (FLOATP (accum) && isnan (XFLOAT_DATA (accum)))
2975 return accum; 2976 return accum;
2976 } 2977 }
2977 return MARKERP (accum) ? make_number (marker_position (accum)) : accum; 2978 return accum;
2978} 2979}
2979 2980
2980DEFUN ("max", Fmax, Smax, 1, MANY, 0, 2981DEFUN ("max", Fmax, Smax, 1, MANY, 0,
2981 doc: /* Return largest of all the arguments (which must be numbers or markers). 2982 doc: /* Return largest of all the arguments (which must be numbers or markers).
2983The value is always a number; markers are converted to numbers.
2982usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) 2984usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2983 (ptrdiff_t nargs, Lisp_Object *args) 2985 (ptrdiff_t nargs, Lisp_Object *args)
2984{ 2986{
@@ -2987,6 +2989,7 @@ usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2987 2989
2988DEFUN ("min", Fmin, Smin, 1, MANY, 0, 2990DEFUN ("min", Fmin, Smin, 1, MANY, 0,
2989 doc: /* Return smallest of all the arguments (which must be numbers or markers). 2991 doc: /* Return smallest of all the arguments (which must be numbers or markers).
2992The value is always a number; markers are converted to numbers.
2990usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */) 2993usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
2991 (ptrdiff_t nargs, Lisp_Object *args) 2994 (ptrdiff_t nargs, Lisp_Object *args)
2992{ 2995{