JLD.jl icon indicating copy to clipboard operation
JLD.jl copied to clipboard

Int128

Open eschnett opened this issue 9 years ago • 0 comments
trafficstars

The documentation says:

Int128/Uint128: presumably similar to Complex128 (encode as pair of Uint64). The holdup: is the sign bit portable?

HDF5 allows defining arbitrary integer datatypes by specifying their number of bits. This would seem to be the most natural approach.

Otherwise, a similarly "natural" approach would be to manually decompose them into their lower and upper 64 bits, and storing these as Uint64 and Int64, respectively. (Uint128 is then stored as two UInt64.) This is portable; there is no computing architecture today that deviates from the signed two's complement representation.

eschnett avatar Nov 22 '15 15:11 eschnett