# Number methods

Although CSML differentiates between *Float* and *Integer*, all methods are available on all Number types. Hence, the *Number* type does not really exist but represents indifferently *Float* and *Integer*.

Given the automatic type inference, CSML will automatically try to map integers and floats to whichever type makes more sense in the context.

### .pow(Number)

Raise the target integer to the power of the given integer.

```cpp
number.pow(Number) => Number

// example
do val = 3
do val.pow(2) // 9
```

### .abs()

Return the absolute value of the target number.

```cpp
integer.abs() => Number

// example
do val = -42
do val.abs() // 42
```

### .cos(), .sin(), .tan()

Return the cosine, sine or tangent of the target number.

```cpp
float.cos() => Float
float.sin() => Float

// example
do val = 12.34
do val.cos() // 0,9744873988
do val.sin() // -0,224442219
do val.tan() // -0,2303182363
```

### .floor(), .ceil(), .round()

Round the number respectively down, up or using mathematical rounding.

```cpp
float.floor() => Integer
float.ceil() => Integer
float.round() => Integer

// example
do val = 10.5
do val.floor() // 10
do val.ceil() // 11
do val.round() // 11
```

### .precision(n)

```cpp
do val = 1.234567.precision(2) // 1.23
```


---

# 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.csml.dev/language/standard-library/number-methods.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.
