[erlang-questions] Endian numbers

Jared Kofron jared.nance@REDACTED
Sat Dec 18 07:48:26 CET 2010


Big vs. little endian has to do with whether the most significant byte comes first in the list or the least significant byte.  'Native' encoding means native to the machine that is interpreting the bitstring.  If you look at the encodings you showed below, you can see this effect as the bytes being read from left to right instead of right to left.

JK

Hi all,
I’ve been always wondering that is the meaning of endian term, for example in the Bit syntax
 
{<<16#12345678:32/big>>,<<16#12345678:32/little>>,
<<16#12345678:32/native>>,<<16#12345678:32>>}.
{<<18,52,86,120>>,<<120,86,52,18>>,
<<120,86,52,18>>,<<18,52,86,120>>}
 
What is the meaning of that I mean what is the different between big, little or native. And the different endian machines. In the JInterface there is a reference to that term too, the big endian the little endian and so on.
Could anybody explain this to me, I need to now that very well so I can put that in my book.
 
 
Regards,
 
Ivan.
 
-------------------------------------------------------------------------------------------------------------
Ing: Ivan Carmenates García
Current project: ExtendedVisualOtp and Erlang Book: "Erlang Avanzado para principiantes"
Ivanco Software Company in association with SPI Team

 
 
 

=======================================================================
Este mensaje ha sido enviado mediante el servicio de correo electrónico que ofrece la Federación de Radioaficionados de Cuba a sus miembros para respaldar el cumplimiento de los objetivos de la organización y su política informativa. La persona que envía este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas.


More information about the erlang-questions mailing list