integer arithmetics

Jaroslav Hajek highegg at gmail.com
Wed Oct 1 14:07:53 CDT 2008


On Wed, Oct 1, 2008 at 5:14 PM, John W. Eaton <jwe at bevo.che.wisc.edu> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: int_patch2.diff
Type: text/x-diff
Size: 38051 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081001/28d055fe/attachment-0001.bin 


More information about the Octave-maintainers mailing list