Tim Pease
10/25/2006 2:56:00 PM
On 10/24/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> On Wed, 25 Oct 2006, Tim Pease wrote:
>
> > Does ruby provide a global or a method call to determine the endianess
> > of the underlying platform?
> >
> > This is what I cooked up, but I'm wondering if there is a ruby way of
> > doing this.
> >
> >
> > BIG_ENDIAN = [0xFF00].pack('S') == [0xFF00].pack('n')
> >
> >
> > Blessings,
> > TwP
>
> you could at least have more fun
>
> little_endian = [42].pack('i')[0] == 42
>
> ;-)
>
Very tricksie of you! I'm always amazed at how your mind operates.
TwP