emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bignum speedup patch causes crash at startup


From: Paul Eggert
Subject: Re: Bignum speedup patch causes crash at startup
Date: Tue, 4 Sep 2018 11:59:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Eli Zaretskii wrote:
I don't understand why it prefers GMP calls to a simple double
division, when both arguments are fixnums.  What am I missing?

First, converting a fixnum to a double can lose info. Second, the double division could round, which would mean the result would be double-rounded. We're already suffering from double-rounding when either argument is floating-point, and we don't want that bug to also infect integer division. So even the Emacs 26 code (which doesn't have bignums) must use integer division here, not double division.

This is worth commenting so I installed the attached. While writing the comment I noticed there's a bug when one argument is a bignum and the other is a float, so I fixed that in the attached too.

Attachment: 0001-Fix-round-FLOAT-BIGNUM-bug.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]