A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/020925.html below:

[Python-Dev] Boolean transition

[Python-Dev] Boolean transition [Python-Dev] Boolean transitionTim Peters tim.one@comcast.net
Sun, 10 Mar 2002 22:56:02 -0500
[David Abrahams]
> Actually, I'm a C++ guy: && and || return false or true.
> I think 'C99' also got some kind of _Bool type, but I don't know how it
> acts.

#define bool _Bool
#define false 0
#define true 1
#define __bool_true_false_are_defined 1

are in <stdbool.h>.  _Bool is an unsigned integral type, subject to the
usual promotions.  Just about the only twist beyond that is that conversion
of a scalar s to _Bool yields 1 if and only if s != 0.  So, e.g.,

    bool b = 0.16; /* sets b to 1 */

&& and || haven't changed (return int 0 or int 1).




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4