From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,353213c6ba11774a X-Google-Attributes: gid1164f8,public From: Paul DeMone Subject: Re: DEC Unix 4.0 IEEE floating point on Alpha Date: 1997/07/23 Message-ID: <33D6C4C2.63B7@EasyInternet.net>#1/1 X-Deja-AN: 258410545 References: <5r5qt6$gd8@crcnis3.unl.edu> Organization: UUNET Canada News Transport Newsgroups: comp.sys.dec James Nau wrote: > > Hi all, > > I've come across a problem with the floating point format on > DEC alphas. It happens under both VMS and Digital Unix. It > appears to me that Alphas store IEEE floating point numbers > backwards. On an Alpha, for value 511.0, I get: > > 00 80 FF 43 > > as the binary representation [written by > fwrite( &x, sizeof(float), 1, outfile);] > > while on every other Unix workstation I've been able to get my fingers > on yields: > > 43 FF 80 00 > > which all the tools and info I find say this is 511.0 in IEEE format.[snip] It looks like a byte endianess problem to me. The Alpha runs in little endian mode (like VAX and x86) while 68K, SPARC, and non-DEC MIPS based workstations run in big endian mode. You could write FP values to a file in big endian order on your Alpha if you alias a char array over the FP value in memory and pick up the bytes in reverse order and write them individually to your file There are probably more elegent ways of doing this... > james > > james@engrs.unl.edu -- Paul W. DeMone The 801 experiment SPARCed an ARMs race Kanata, Ontario to put more PRECISION and POWER into demone@mosaid.com architectures with MIPSed results but PaulDeMone@EasyInternet.net ALPHA's well that ends well.