From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 23142 invoked from network); 6 Apr 1998 13:00:24 -0000 Received: from smtp0-alterdial.uu.net (192.48.96.28) by mail2.redhat.com with SMTP; 6 Apr 1998 13:00:24 -0000 Received: from pop0-alterdial.uu.net by smtp0-alterdial.uu.net with ESMTP (peer crosschecked as: pop0-alterdial.UU.NET [192.48.96.27]) id QQejya20860; Mon, 6 Apr 1998 13:00:24 GMT Received: from clove.com by pop0-alterdial.uu.net with SMTP (peer crosschecked as: pm2-mbg-3.midtel.net [208.129.80.52]) id QQejya06952; Mon, 6 Apr 1998 13:00:22 GMT Received: from clove1.clove.com by clove.com (SMI-8.6/SMI-SVR4) id IAA03820; Mon, 6 Apr 1998 08:39:24 -0400 Message-Id: <199804061239.IAA03820@clove.com> Reply-To: To: axp-list@redhat.com cc: clove1!mike@uunet.uu.net Subject: Re: OFF-TOPIC: little-endian vs. big-endian conversion In-reply-to: Your message of "Fri, 03 Apr 1998 12:15:05 EST." Date: Mon, 06 Apr 1998 08:39:22 -0400 From: Mike Howard You can spend a lot of time on a problem like this. If you have control of the source of the data or access to a similarly configured SGI machine, your best approach is to reformat the data [or have it done] in ASCII. Things are probably more standard than they used to be - with most supporting IEEE floating point - but in the old days, in trying to do this type of thing I had to contend with: 1's complement versus 2's complement machines 15, 16, and 18 bit half word sizes 16, 32, 36, & 64 bit word sizes 30, 32, 36, 60, 64, & 72 bit floating point sizes plethora's of floating point formats for example: a floating point word consists of a characteristic and a mantissa. Generally, the mantissa is a 1 or 2's complement integer or an unsigned integer which represents a number between 1 and the smallest representable fraction or zero. The characteristic is the exponent of an implied base which can be 2, 8, 16, 256, 10, or whatever bright number the designer has chosen. It is an N bit number which represents a range of exponent values between the largest and smallest possible ranges. Encodings I have seen are 1's and 2's comlement and excess N - where N = 2^(width of exponent - 1) [treat the exponent as a signed number and encode by adding N, so the encoded value is always positive]. This information is always tough to find - because no one needs it except compiler writers. Generally it will be in the hardware architecture or assembler references for the machines in question. Varian used to support several formats because they made both 16 and 18 bit machines. If you really have to do this, you have my sympathy. Mike Howard