[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely la
From: |
arnold |
Subject: |
Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs |
Date: |
Fri, 28 Jan 2022 01:46:19 -0700 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
<pjfarley3@earthlink.net> wrote:
> There are also several strange uses of the exclamation point operator
> (!) that I do not understand, but that is probably just my lack of
> experience. Examples of such use are:
>
> _n1-!!_n1
> -!-""
> !+""
> !--_n10
>
> I THINK these are intended to be uses of the negation operator, but I
> don’t understand what that operation is supposed to do to an empty
> string.
Using ! converts non-zero to zero and zero to one, depending on the
value of the expression to which it is applied.
!! <something>
converts <something> into a canonical truth value of 1 or 0. This can
occasionally be useful in C / C++ as well:
const char *truth_value[] = { "false", "true" };
printf("xyzzy is %s\n", truth_value[!! (some_expression)]);
Arnold
- Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Jason C. Kwan, 2022/01/26
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, arnold, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Jason C. Kwan, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, arnold, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Andrew J. Schorr, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Jason C. Kwan, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Andrew J. Schorr, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, Wolfgang Laun, 2022/01/27
- RE: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, pjfarley3, 2022/01/27
- Re: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs,
arnold <=
- RE: Slowness in bignum mode ( gmp | gawk -M ) when doubling extremely large inputs, pjfarley3, 2022/01/28
- Use of !!, arnold, 2022/01/29