IBM integer and double formats

John Machin sjmachin at lexicon.net
Tue Nov 11 06:36:59 EST 2008


On Nov 11, 8:15 pm, Mark Dickinson <dicki... at gmail.com> wrote:
> On Nov 10, 11:49 pm, John Machin <sjmac... at lexicon.net> wrote:
>
> > Call me crazy if you like, but I'd name that function IEEEtoIBM.
>
> But it's topsy-turvy day!  Didn't you get the memo?
>
> Oh, all right.  IEEEtoIBM it is.
>
> > That's a hexadecimal representation in lowercase with no leading
> > zeroes ... variable length and lowercase doesn't seem very IBM to me.
>
> True.  Replace "%x" with "%016X" for fixed-length uppercase. Or as you
> say, bytes output is probably more natural.  I was guessing that the
> OP
> wants to write the converted float out to an ASCII file, in hex.

Sheesh. It's an *IBM mainframe* file. It would need to be in EBCDIC,
not ASCII. But why guess? He said he wanted to write it out in SAS
XPORT format.








More information about the Python-list mailing list