3 ms·
Indeed. There are few wide-spread programming languages around any more that lack such things as, say, any form of arithmetic whatsoever.
by breadbox 12y ago
Indeed. There are few wide-spread programming languages around any more that lack such things as, say, any form of arithmetic whatsoever.
- mtdewcmu 12y agosed has regular expressions. I think you could do some binary arithmetic fairly easily with regular expressions and find and replace...
- breadbox 12y agoYep, that's pretty much how you have to do it. (If all you need is increment/decrement, though, you can actually do it pretty concisely with decimal-digit strings. Skipping the binary-to-decimal conversion greatly simplifies displaying numerical values.)
- mtdewcmu 12y agoThe GNU sed manual has examples like that at the end. It always seemed odd to show examples of things that are so awkward and inefficient. If they meant for sed to do those things, presumably they would have made commands for them.
- userbinator 12y ago> to show examples of things that are so awkward and inefficient
- deleted 12y ago[deleted]
- mtdewcmu 12y agoYeah. As in, better done in awk. The opposite of awkward is sedward.