# Float numbers

Operators and functions for working with decimal numbers of **float** type are described here.

* [bool( float f ) bool](/stdlib/float.md#bool-float-f-bool)
* [Ceil( float f ) int](/stdlib/float.md#ceil-float-f-int)
* [Floor( float f ) int](/stdlib/float.md#floor-float-f-int)
* [int( float f ) int](/stdlib/float.md#int-float-f-int)
* [Max( float fl, float fr ) float](/stdlib/float.md#max-float-fl-float-fr-float)
* [Min( float fl, float fr ) float](/stdlib/float.md#min-float-fl-float-fr-float)
* [Round( float f ) int](/stdlib/float.md#round-float-f-int)
* [Round( float f, int digit ) float](/stdlib/float.md#round-float-f-int-digit-float)
* [str( float f ) str](/stdlib/float.md#str-float-f-str)

## Operators

| Operator            | Result | Description                                                                                   |
| ------------------- | ------ | --------------------------------------------------------------------------------------------- |
| float **?**         | bool   | Calls *bool(float)*.                                                                          |
| float **+** float   | float  | Adds two numbers.                                                                             |
| float **+** int     | float  |                                                                                               |
| int **+** float     | float  |                                                                                               |
| float **-** float   | float  | Subtracts second number from the first.                                                       |
| float **-** int     | float  |                                                                                               |
| int **-** float     | float  |                                                                                               |
| float **\*** float  | float  | Multiplies both numbers.                                                                      |
| float **\*** int    | float  |                                                                                               |
| int **\*** float    | float  |                                                                                               |
| float **/** float   | float  | The division of two numbers. When dividing by zero, an error is returned.                     |
| float **/** int     | float  |                                                                                               |
| int **/** float     | float  |                                                                                               |
| float **==** float  | bool   | Returns true if two numbers are equal and false, otherwise.                                   |
| float **==** int    | bool   |                                                                                               |
| float **>** float   | bool   | Returns true if the first number is greater than the second and false, otherwise.             |
| float **>** int     | bool   |                                                                                               |
| float **<** float   | bool   | Returns true if the first number is less than the second and false, otherwise.                |
| float **<** int     | bool   |                                                                                               |
| float **!=** float  | bool   | Returns true if two numbers are not equal and false, otherwise.                               |
| float **!=** int    | bool   |                                                                                               |
| float **>=** float  | bool   | Returns true if the first number is greater than or equal to the second and false, otherwise. |
| float **>=** int    | bool   |                                                                                               |
| float **<=** float  | bool   | Returns true if the first number is less than or equal to the second and false, otherwise.    |
| float **<=** int    | bool   |                                                                                               |
| **-** float         | float  | Change the sign of a decimal number.                                                          |
| float **=** float   | float  | Simple assignment operator.                                                                   |
| float **+=** float  | float  | Add and assignment operator.                                                                  |
| float **-=** float  | float  | Subtract and assignment operator.                                                             |
| float **/=** float  | float  | Divide and assignment operator.                                                               |
| float **\*=** float | float  | Multiply and assignment operator.                                                             |

## Functions

### bool(float f) bool

The bool function returns false if the passed parameter is 0.0, otherwise it returns true.

### int(float f) int

The *int* function converts a decimal number to an integer number which is less than or equal to this number.

### str(float f) str

The *str* function converts a decimal number to a string.

### Ceil(float f) int

The *Ceil* function returns the least integer value greater than or equal to *f*.

### Floor(float f) int

The *Floor* function returns the greatest integer value less than or equal to *f*.

### Max(float fl, float fr) float

The *Max* function returns the maximum of two values.

### Min(float fl, float fr) float

The *Min* function returns the minimum of two values.

### Round(float f) int

The *Round* function returns the nearest integer, rounding half away from zero.

```
   Round(4.5) // 5
   Round(4.1) // 4
   Round(4.9) // 5
```

### Round(float f, int digit) float

The *Round* function rounds *f* to the specified number of decimal places.

```
   Round(4.567, 2) // 4.57
   Round(4.111, 1) // 4.1
```


---

# 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/float.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.
