Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Sep 2016 20:41:44 +0000
From:      Daniel Shahaf <danielsh@apache.org>
To:        Cedric Blancher <cedric.blancher@gmail.com>
Cc:        twilight <pipfstarrd@openmailbox.org>, freebsd-hackers@freebsd.org
Subject:   Re: What is the point in expression: !!var ?
Message-ID:  <20160913204144.GA13610@fujitsu.shahaf.local2>
In-Reply-To: <CALXu0UcLaNgEyd_SLxSRDMDv6kjsDKpPDRc%2BHHJfyAv-YAmYkQ@mail.gmail.com>
References:  <7bf5cd37-6436-8cec-74e3-f0856bcc807c@openmailbox.org> <CALXu0UcLaNgEyd_SLxSRDMDv6kjsDKpPDRc%2BHHJfyAv-YAmYkQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Cedric Blancher wrote on Tue, Sep 13, 2016 at 22:10:24 +0200:
> The point is to transform the value of a (any kind, like pointer) to a
> Boolean value.

In more words: «!!x» is equivalent to «(x ? 1 : 0)».

Daniel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160913204144.GA13610>