[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: How to check endianess using ruby?

Heesob Park

12/19/2008 5:03:00 AM

Hi,

2008/12/19 Xie Hanjian <jan.h.xie@gmail.com>:
> Hi,
>
> What's the right way to check the endianess(big/little endian) of the machine
> on which the ruby code run?
>
[1].pack('S')[0]==1 ? 'little' : 'big'

Regards,
Park Heesob