From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Strange division using mixed integers and floats
Date: Tue, 27 Apr 2004 09:46:30 -0600 [thread overview]
Message-ID: <408E8056.2070909@yahoo.com> (raw)
In-Reply-To: yoijk702ye7i.fsf@frealaf.dd.chalmers.se
Johan Bockga*rd wrote:
> Ok, I know why this happens:
>
> (/ 5 4) => 1
>
> But this behaviour is *highly* confusing:
>
> (/ 5 4 2.3) => 0.4347826086956522
>
> Cf. (/ 5 4.0 2.3) => 0.5434782608695653
>
> At least there should be a warning in the manual.
*** elisp-manual-21-2.8/numbers.texi.orig Sat Sep 8 11:42:52 2001
--- elisp-manual-21-2.8/numbers.texi Tue Apr 27 09:45:26 2004
***************
*** 541,547 ****
divides @var{dividend} by each divisor in turn. Each argument may be a
number or a marker.
! If all the arguments are integers, then the result is an integer too.
This means the result has to be rounded. On most machines, the result
is rounded towards zero after each division, but some machines may round
differently with negative arguments. This is because the Lisp function
--- 541,548 ----
divides @var{dividend} by each divisor in turn. Each argument may be a
number or a marker.
! If both of the arguments are integers, then the result---the
! intermediate result, if there are additional arguments---is an integer too.
This means the result has to be rounded. On most machines, the result
is rounded towards zero after each division, but some machines may round
differently with negative arguments. This is because the Lisp function
--
Kevin Rodgers
prev parent reply other threads:[~2004-04-27 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-26 15:02 Strange division using mixed integers and floats Johan Bockgård
2004-04-27 15:46 ` Kevin Rodgers [this message]
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=408E8056.2070909@yahoo.com \
--to=ihs_4664@yahoo.com \
/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).