[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using the GNU GMP Library for Bignums in Emacs
From: |
Eli Zaretskii |
Subject: |
Re: Using the GNU GMP Library for Bignums in Emacs |
Date: |
Wed, 18 Jul 2018 18:55:35 +0300 |
> From: Paul Eggert <address@hidden>
> Date: Wed, 18 Jul 2018 03:20:40 -0700
> Cc: Tom Tromey <address@hidden>, address@hidden
>
> +/* Return true if X and Y are the same floating-point value.
> + This looks at X's and Y's representation, since (unlike '==')
> + it returns true if X and Y are the same NaN. */
> +static bool
> +same_float (Lisp_Object x, Lisp_Object y)
> +{
> + union double_and_words
> + xu = { .val = XFLOAT_DATA (x) },
> + yu = { .val = XFLOAT_DATA (y) };
> + EMACS_UINT neql = 0;
> + for (int i = 0; i < WORDS_PER_DOUBLE; i++)
> + neql |= xu.word[i] ^ yu.word[i];
> + return !neql;
> +}
Wouldn't calling this upon every float comparison yield a
non-negligible run-time penalty? Maybe we should use 'isnan' instead?
- Re: Making 'eq' == 'eql' in bignum branch, (continued)
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/30
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/31
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/31
- RE: Making 'eq' == 'eql' in bignum branch, Drew Adams, 2018/07/31
- Re: Making 'eq' == 'eql' in bignum branch, Eli Zaretskii, 2018/07/31
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/07/31
- Re: Using the GNU GMP Library for Bignums in Emacs,
Eli Zaretskii <=
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/07/18
- Re: Using the GNU GMP Library for Bignums in Emacs, Ken Raeburn, 2018/07/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/07/22
- Re: Using the GNU GMP Library for Bignums in Emacs, Achim Gratz, 2018/07/22