> For example, you repeat the following sed on it until it
> doesn't change any more:
>
> [snip]
You can use the t command to avoid looping.
However, while indeed a bit of a hassle, doing arithmetic with sed is not so
hard... You can use 10 commands to sum two numbers:
http://sed.sourceforge.net/
Paul Eggert wrote:
> #define SIZE_MAX
> (2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(1ul)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)
>
> and expressions like these can be computed easily using binary
Bruno Haible <[EMAIL PROTECTED]> writes:
> 'expr' is certainly the easiest auxiliary program that can be used to
> compute "2*x" and "(x+y)/2" for some integers x and y, but it's not the
> only one. You could also use 'sed' for this purpose.
Oh my goodness, I hadn't thought of that! But I'd rath
Paul Eggert wrote:
> > dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses
> > 'expr', dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
> > ...
> >_AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
> > [#include ], result=?)
> >_AC_COMPUTE_INT([~(size_t)0 % 10],