[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: integer arithmetics
From: |
Jaroslav Hajek |
Subject: |
Re: integer arithmetics |
Date: |
Wed, 1 Oct 2008 21:07:53 +0200 |
On Wed, Oct 1, 2008 at 5:14 PM, John W. Eaton <address@hidden> wrote:
> On 23-Sep-2008, Jaroslav Hajek wrote:
>
> | Sorry. I didn't realize that std::abs (int) is declared in cstdlib,
> | not cmath. Please try again, same location. This new one should also
> | get rid of the unused vars warnings you see.
>
> OK.
>
> I applied this changeset.
>
Hmm, initially I didn't mean this to go into 3.2.x, but if you're fine
with that, then why not. Please consider also the attached patch, that
fully implements the 64-bit arithmetics.
If at least 80-bit wide long double type is discovered, it is used to
implement 64-bit multiplication and mixed operations, otherwise, more
complicated non-inline code is employed. In the latter case, some
operations may suffer from precision loss (converting int64->double)
or early truncation - see comments in oct-inttypes.cc. I think that
the important cases (int64 +- double) are OK, and that one can live
with losing precision when doing, for instance, 4611686018427387901 *
0.75. Maybe these emulations will be improved over time (though at a
performance cost).
OK to push?
regards
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
int_patch2.diff
Description: Text Data
- Re: integer arithmetics, John W. Eaton, 2008/10/01
- Re: integer arithmetics,
Jaroslav Hajek <=
- Re: integer arithmetics, John W. Eaton, 2008/10/01
- Re: integer arithmetics, Jaroslav Hajek, 2008/10/02
- Re: integer arithmetics, Jaroslav Hajek, 2008/10/02
- Re: integer arithmetics, Jaroslav Hajek, 2008/10/02
- Re: integer arithmetics, John W. Eaton, 2008/10/02
- Re: integer arithmetics, Jaroslav Hajek, 2008/10/02
- Re: integer arithmetics, John W. Eaton, 2008/10/02
- Re: integer arithmetics, Jaroslav Hajek, 2008/10/02
- Re: integer arithmetics, John W. Eaton, 2008/10/02
- Re: integer arithmetics, John W. Eaton, 2008/10/02