# Логический тип

Здесь описаны операторы и функции для работы с логическим типом **bool**.

* [int( bool b ) int](/stdlib/bool.md#int-bool-b-int)
* [str( bool b ) str](/stdlib/bool.md#str-bool-b-str)

## Операторы

| Оператор           | Результат | Описание                                                                |
| ------------------ | --------- | ----------------------------------------------------------------------- |
| bool **&&** bool   | bool      | Логическое И. Условие истинно, если истинны оба операнда.               |
| bool **\|\|** bool | bool      | Логическое ИЛИ. Условие истинно, если истинен хотябы один из операндов. |
| **!** bool         | bool      | Логическое НЕ.                                                          |
| bool **=** bool    | bool      | Присваивание.                                                           |

## Функции

### int(bool b) int

Функция *int* возвращает 1, если параметр имеет значение *true* и возвращает 0 в противном случае.

### str(bool b) str

Функция *str* возвращает строку "true", если параметр имеет значение *true* и возвращает строку "false" в противном случае.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ru.gentee.org/stdlib/bool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
