summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/data.c b/src/data.c
index b85d8a77106..33fe2855c99 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2603,6 +2603,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
accum = 0;
break;
case Amult:
+ case Adiv:
accum = 1;
break;
case Alogand:
@@ -2658,7 +2659,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
accum *= next;
break;
case Adiv:
- if (!argnum)
+ if (! (argnum || nargs == 1))
accum = next;
else
{
@@ -2727,7 +2728,7 @@ float_arith_driver (double accum, ptrdiff_t argnum, enum arithop code,
accum *= next;
break;
case Adiv:
- if (!argnum)
+ if (! (argnum || nargs == 1))
accum = next;
else
{
@@ -2782,9 +2783,11 @@ usage: (* &rest NUMBERS-OR-MARKERS) */)
}
DEFUN ("/", Fquo, Squo, 1, MANY, 0,
- doc: /* Return first argument divided by all the remaining arguments.
+ doc: /* Divide number by divisors and return the result.
+With two or more arguments, return first argument divided by the rest.
+With one argument, return 1 divided by the argument.
The arguments must be numbers or markers.
-usage: (/ DIVIDEND &rest DIVISORS) */)
+usage: (/ NUMBER &rest DIVISORS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
ptrdiff_t argnum;