Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It looks like the Hindu numbers originated in a left-to-right script https://en.wikipedia.org/wiki/Brahmi_script though I couldn't find Wikipedia addressing this endianness question in the pages on Hindu-Arabic numerals.

Agreed re little-endian being at least as natural, and apparent historical accidents.

(Edit: I'm doubting the advantage claimed below, now that I wrote it out. The mental ops are serial either way.)

There is a small advantage of big-endian for manual arithmetic which I only noticed the other day: in summing a column of numbers in carry-save style, it seems easiest to add the digits left-to-right in your inner loop, with a one-digit mental scratchpad and a one-line accumulator. Pretty much opposite of what I was taught in grade school.

("Carry-save" means expanding the range of digits from 0-9 to 0-a (10), and delaying carry propagation until the very end. So the scratchpad digit may need incrementing before going into the accumulator, depending on the next single-digit addition, but carries never propagate further than that one place per step until you reach the bottom line. This seems to help in bounding the needs for short-term memory and avoiding variation in steps which could throw you off, as a fallible human.)



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

Search: