HN2new | past | comments | ask | show | jobs | submitlogin

For those who don't know, that's why big and little endian were called that, because the debate was so frivolous. It's a reference to the book Gulliver's Travels by Jonathan Swift in which an island folk was split about from which end you should crack a boiled egg. (I'm a big endian for example).


Wait, hasn't everybody learned about inside-out endian? The highest order bit is in the middle, then proceeds along a hilbert path to the edges


No, but that's how I peel an egg.


Try to find (or even better, write) a big-endian arbitrary-precision arithmetic implementation if you're convinced that the difference is frivolous. You'll easily see why one is sometimes called "logical endian" and the other "backwards endian".


Or try to read numbers in a hex editor, and quickly obtain the opposite conclusion. :)


I used to be big endian. Then i changed my mind. Have a look at the following:

-123 -12 -1

Here are three numbers. If we read them from left to right, they all begin with 1, but we cant tell what the 1 means, in one case it means 100, in one it means 10 and in one it means 1. We need to parse the entire number to know what the first number means. If we parse from right to left, each number always means the same thing. the first is how many once, the second how many 10s and so on.

So it makes sense to store the smallest first. In a big endian architecture, if i want to read an 8, 16, 32 or 64 bit word each byte will always mean the same, if we pad out the type with zeros. So little endian is right, and Arabic numerals are wrong.


Arabic numerals are little endian when writing right-to-left. Like Arabic is written.


Indic scripts are LTR, and so stayed the big-endian numerals when they were borrowed by medieval Islamic mathematicians. Numerals in modern spoken Arabic are big endian (mostly, with an exception for the teens that also exists in English).


Yes, you are right!


It looks like the comment you're replying to was talking about eggs. I'm little endian by the way.


Genuinely curious, what are any advantages of big endian other than "it's how we write numbers in base 10?"


Sorting (assuming your numbers are unsigned and same width, you can sort them as byte strings).

Dispatch (if only the topmost n-bits (or bytes) are needed to make a decision, that's all you need to read).


Signs and strings


I'm firmly in the little-endian camp for eggs, but big-endian for CPUs.


Watch as every pitchfork gets pointed at you when you talk about middle endian.

Which is a real thing. There are systems that would store, say, a 32-bit word as two 16-bit words that were big endian relative to each other, but little endian within the 16-bit word.


Yes, but which order are the bits stored in each byte?


Found my archnemesis.


Do you even care about CPUs anymore?


Well, boiled eggs definitely taste better.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: