On 2020-01-24 01:17, Marcel Timmerman wrote:
On 1/23/20 6:28 PM, ToddAndMargo via perl6-users wrote:
On Thu, Jan 23, 2020 at 11:51 AM ToddAndMargo via perl6-users
<perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:
Hi All,
This is just a trivia question.
Does anyone know if the actual data stored in
Raku variables is little endian or big endian?
-T
On 2020-01-23 09:07, Paul Procacci wrote:
endianess is dictate by the cpu.
If I store the value 4 into some memory address, the storage of and
retrieval thereof is controlled by the cpu.
Then I presume Raku rug on a Intel processor would
be little endian. So when I enter 0xFF44 it is
really being stored as 44, FF in memory. Interesting.
Most of the time you don't really need to know unless you move your data
from one machine to another in binary form. In that case you need a test
before interpreting the data.
Marcel
Hi Marcel,
The reason for the trivia quest was that I have been
doing a lot of stuff with NativeCall lately and
you have to prepare data in little endian to
send to NativeCall and to interpret bytes of little
endian when it come back. So I was just curious.
Chuckle. The travails of a high level language:
take litle endian apart to put them back together
to be restored in what looks like big endian but
really is little endian under the hood.
-T