bool
ブール
解説 Definition
プログラミングにおける真偽値(trueまたはfalse)を表すデータ型。booleanの短縮形。
A bool is a data type in programming that can have only two values: true or false. It is used when a program needs a simple yes-or-no condition. The word is a short form of boolean and is mainly used in technical contexts.
覚え方のコツ Memory Tip
bool は boolean の省略形として覚えるのが最短です。まず boolean=「true / false の2択」を表す語だと押さえ、その短い実務形が bool だと結びつけます。数を入れる int、文字を入れる string と並べて、「bool は答えが Yes/No だけの箱」と整理すると定着しやすいです。if 文や flag 変数で頻出し、is_valid, has_error など“状態を問う名前”と一緒に出ることが多いので、値そのものより判定用の型だと意識すると混同しにくくなります。
Remember bool from Boolean and from the pair true / false. In code, it often appears next to int and string, so treat it as one of the basic data types. Variable names like is_open or has_data are a strong clue that the value is a bool.
例文
In most programming languages, a bool variable can only hold a value of true or false.
ほとんどのプログラミング言語で、ブール変数はtrueまたはfalseの値しか保持できない。
The function returns a bool indicating whether the operation was successful.
その関数は操作が成功したかどうかを示すブール値を返す。
When declaring a bool in C++, it is initialized to false by default.
C++でブール型を宣言すると、デフォルトではfalseに初期化される。
bool の類義語・関連語
類義語
bool の語源・成り立ち Etymology
bool はプログラミングで使う boolean の短縮形で、boolean は英国の数学者 George Boole の名に由来します。人名由来なので接辞分解より語源が重要で、Boolean algebra や Boolean operator と同じく、真偽二値を扱う語だからこの名になりました。
Bool is a shortened form of Boolean, a term named after the English mathematician George Boole. His name became attached to a system of logic based on two values. In computing, the shorter form bool developed as a practical label in programming languages. Related terms include Boolean algebra and Boolean operator.
同じレベルの英単語をもっと
外部辞書で調べる
この単語を英単語クイズで覚えよう