Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "little-endian"
-
Today I learned that the big-endian and little-endian naming comes from Gulliver's Travels, where Lilliputs argue over whether to break eggs on the little-end or big-end!3
-
Staring at computer trying to figure out why I can't read a float from modbus. I swapped the bytes correctly for my platform. I also ensured the endianess of the words matched my platform (byte endianess is not the sames as word endianess, fml). Was driving home thinking about what could be wrong. My mind saw this code:
uint32_t newint;
for(int count=0; count<2; count++){
newint |= words[count] << count;
}
Then I am fuck! It should be:
newint |= words[count] << (count*16);
This was later turned into float. I kept getting values in the 1e-40 or some shit. Now it makes sense. The upper word was not set.
This is such newb shit. Fuck you newb shit I should just know!
Reading more I realized that the endianess of words can vary between devices even though the spec calls for big endian words. Fuck you non-compliant vendors! So I gotta add a flag for fucked up devices. Fine. The pay off is a generic way to add modbus to our opcua server. I want this easily editable in the field. For now it is readonly. So that makes it nicer.
Just a little torqued that I solved this driving home instead of at work. Too close to the code. I think tomorrow I will have my boss review it to tell me of other logical crap I missed.3 -
Today I had a co-worker ask how we can set a value in the registry since this other program we are working with encrypts it. My response was, "It isn't encrypted, it is little-endian." Then I went into the whole endianness topic. After finally telling him how to convert the hex values in the registry back to the original decimal value that the program is storing, he said, "I'll just take your word for it."1
-
I told a computer architect that I like to break eggs by the big end. He won't talk to me anymore 🤔2
-
I guess I can say the Dutch numbering system is little-endian.
All the other languages are big-endian.
Then there's French.3 -
Mass pole here:
Big Endian or Little Endian?
camelCase or UpperCase?
Brackets on new line or same line?
Apple or Android?
Favourite language?
What language do you despise?
Age? (Don't mean to be creepy with this one, I have my reasons)29 -
One little two little three little endian
Four little five little six little endian
Seven little eight little nine little endian
Ten little endian bytes1 -
memcpy to fill a struct in an environment that should run on both big and little endian HW...
Yep that guy went on to project management. 😂 -
!rant
I'm a starting programmer. So when my supervisor asks me to write a report and test against 50 coordinates written in little endian hex form in excel, I got lazy and wrote a code that gives me all the coordinates in decimal to be input into my excel program.
Anyone know an easier method tho?