# Boolean

Operators and functions for working with boolean (**bool** type) are described here.

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

## Operators

| Operator           | Result | Description                                                                          |
| ------------------ | ------ | ------------------------------------------------------------------------------------ |
| bool **&&** bool   | bool   | Logical AND operator. If both the operands are true then condition becomes true.     |
| bool **\|\|** bool | bool   | Logical OR Operator. If any of the two operands is true then condition becomes true. |
| **!** bool         | bool   | Logical NOT Operator.                                                                |
| bool **=** bool    | bool   | Assignment operator.                                                                 |

## Functions

### int(bool b) int

The *int* function returns 1 if the parameter is true and returns 0 otherwise.

### str(bool b) str

The *str* function returns the "true" if the parameter is *true* and returns the "false" otherwise.


---

# 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://docs.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.
