Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: Byte order (retitled) Message-ID: <6578@utzoo.UUCP> Date: Thu, 10-Apr-86 15:45:45 EST Article-I.D.: utzoo.6578 Posted: Thu Apr 10 15:45:45 1986 Date-Received: Thu, 10-Apr-86 15:45:45 EST References: <>, <7046@cca.UUCP> Organization: U of Toronto Zoology Lines: 18 > Consider the following problem. You have an array of 4 byte > integers. If you sort the array numerically you get one result. If > you regard the bytes as characters and sort them lexicographically on > a little endian machine you get a different result. The reason is that > the most signifigant byte occupies the eight least signifigant bits. > Consistency of signifigance requires that the direction of signifigance > be the same for both bytes and bits. If your machine has unsigned characters and two's-complement integers with the sign bit in the high bit -- e.g. 360/370 -- then neither byte order will make the two comparisons come out the same. So quite apart from all the other flaws in this argument, it just doesn't work. Before you start defending signed characters, remember that they were another arbitrary invention of the pdp11. And a mistake, too. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry