64-bit integer arithmetics v2

Jaroslav Hajek highegg at gmail.com
Sun Oct 5 04:39:11 CDT 2008


hi,

this is an improved version of the previous attempt at implementing
64-bit arithmetics.
The mixed precision operators and relations should now work robustly
in all cases (and in case you have long double, they will even be fast
:)
These expressions should now work as expected:
uint64(2^64), int64(2^63)...
a = 1.9*2^61; b = uint64(a); b++; b > a
a = 1.9*2^61; b = int64(a); b++; b > a
(note that these two may already work in current tip and/or 3.0.x
because of the CPU using long double behind the scene, but it will
probably depend on optimization level) and maybe more ... (tests yet
to be written).
also, the mixed (u)int64-double binary operations avoid precision loss
(using long double if possible).

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: 47438 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081005/476b352e/attachment-0001.bin 


More information about the Octave-maintainers mailing list