unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: division of integers by floats
Date: Fri, 07 May 2004 21:21:16 -0400	[thread overview]
Message-ID: <E1BMGWi-00013n-Ll@fencepost.gnu.org> (raw)
In-Reply-To: <200405062117.i46LHlKm015566@brains.moreideas.ca> (message from Peter Whaite on Thu, 06 May 2004 17:17:47 -0400)

    Here's a patch to put the change in the DEFUN.  Note that there is no
    effective change for the two arg form, so its still efficient and there
    wont be any "surprises" for the dominant usage.

Your change is ok too.
(Could someone install it, as a "tiny change"?)

--- data.c      6 May 2004 00:10:15 -0000       1.237
+++ data.c      6 May 2004 20:24:25 -0000
@@ -2698,7 +2698,13 @@
      int nargs;
      Lisp_Object *args;
 {
-  return arith_driver (Adiv, nargs, args);
+  int argnum;
+  if (nargs == 2)
+    return arith_driver (Adiv, nargs, args);
+  for (argnum = 0; argnum < nargs; argnum++)
+    if (FLOATP (args[argnum]))
+      return float_arith_driver (0, 0, Adiv, nargs, args);
+  return arith_driver (Adiv, nargs, args);
 }
 
 DEFUN ("%", Frem, Srem, 2, 2, 0,

  reply	other threads:[~2004-05-08  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-05 20:21 division of integers by floats Richard Stallman
2004-05-06 21:17 ` Peter Whaite
2004-05-08  1:21   ` Richard Stallman [this message]
2004-05-08 10:28     ` Piet van Oostrum
2004-05-09  0:49       ` Juanma Barranquero
2004-05-12 15:00       ` Peter Whaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1BMGWi-00013n-Ll@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).