3 ms·
If you ever want to count in base-8 (or a subset), or have an abbreviated form of binary, or pack decimal in a way that's easier to reason, or divide a number i
by peterwwillis 7y ago
If you ever want to count in base-8 (or a subset), or have an abbreviated form of binary, or pack decimal in a way that's easier to reason, or divide a number in half (down to 1) without getting fractions, or represent file permissions (a grouping of four octals).
Is JS a modern language? It was made 24 years ago as a prototype for a scripting language loosely mimicing Java. Presumably octals would have been still used often on recent machines.
- magicalhippo 7y ago> If you ever want to count in base-8 (or a subset) So far I haven't ever had that need it seems. > have an abbreviated form of binary Yeah ok, but why octal over hex? After all, hex maps better to the underlying storage. > pack decimal in a way that's easier to reason How'd that work? I know about BCD but I don't see how octal improves the situation, being base-8. > divide a number in half (down to 1) without getting fractions Huh? > represent file permissions (a grouping of four octals) Ok, I get that for C and such, but how often do you do that in JS? > Is JS a modern language? Compared to C, where octal support is understandable, I'd say yes.