> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.pixeltable.com/_mintlify/feedback/pixeltable/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# math

> <a href="https://github.com/pixeltable/pixeltable/blob/main/pixeltable/functions/math.py#L0" id="viewSource" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/View%20Source%20on%20Github-blue?logo=github&labelColor=gray" alt="View Source on GitHub" style={{ display: 'inline', margin: '0px' }} noZoom /></a>

# <span style={{ 'color': 'gray' }}>module</span>  pixeltable.functions.math

Pixeltable UDFs for mathematical operations.

Example:

```python  theme={null}
import pixeltable as pxt

t = pxt.get_table(...)
t.select(t.float_col.floor()).collect()
```

## <span style={{ 'color': 'gray' }}>udf</span>  abs()

```python Signature theme={null}
@pxt.udf
abs(self: pxt.Float) -> pxt.Float
```

Return the absolute value of the given number.

Equivalent to Python [`builtins.abs()`](https://docs.python.org/3/library/functions.html#abs).

## <span style={{ 'color': 'gray' }}>udf</span>  bitwise\_and()

```python Signature theme={null}
@pxt.udf
bitwise_and(self: pxt.Int, other: pxt.Int) -> pxt.Int
```

Bitwise AND of two integers.

Equivalent to Python
[`self & other`](https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types).

## <span style={{ 'color': 'gray' }}>udf</span>  bitwise\_or()

```python Signature theme={null}
@pxt.udf
bitwise_or(self: pxt.Int, other: pxt.Int) -> pxt.Int
```

Bitwise OR of two integers.

Equivalent to Python
[`self | other`](https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types).

## <span style={{ 'color': 'gray' }}>udf</span>  bitwise\_xor()

```python Signature theme={null}
@pxt.udf
bitwise_xor(self: pxt.Int, other: pxt.Int) -> pxt.Int
```

Bitwise XOR of two integers.

Equivalent to Python
[`self ^ other`](https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types).

## <span style={{ 'color': 'gray' }}>udf</span>  ceil()

```python Signature theme={null}
@pxt.udf
ceil(self: pxt.Float) -> pxt.Float
```

Return the ceiling of the given number.

Equivalent to Python [`float(math.ceil(self))`](https://docs.python.org/3/library/math.html#math.ceil) if `self`
is finite, or `self` itself if `self` is infinite. (This is slightly different from the default behavior of
`math.ceil(self)`, which always returns an `int` and raises an error if `self` is infinite. The behavior in
Pixeltable generalizes the Python operator and is chosen to align with the SQL standard.)

## <span style={{ 'color': 'gray' }}>udf</span>  floor()

```python Signature theme={null}
@pxt.udf
floor(self: pxt.Float) -> pxt.Float
```

Return the ceiling of the given number.

Equivalent to Python [`float(math.floor(self))`](https://docs.python.org/3/library/math.html#math.ceil) if `self`
is finite, or `self` itself if `self` is infinite. (This is slightly different from the default behavior of
`math.floor(self)`, which always returns an `int` and raises an error if `self` is infinite. The behavior of
Pixeltable generalizes the Python operator and is chosen to align with the SQL standard.)

## <span style={{ 'color': 'gray' }}>udf</span>  pow()

```python Signature theme={null}
@pxt.udf
pow(self: pxt.Int, other: pxt.Int) -> pxt.Float
```

Raise `self` to the power of `other`.

Equivalent to Python [`self ** other`](https://docs.python.org/3/library/functions.html#pow).

## <span style={{ 'color': 'gray' }}>udf</span>  round()

```python Signature theme={null}
@pxt.udf
round(
    self: pxt.Float,
    digits: pxt.Int | None = None
) -> pxt.Float
```

Round a number to a given precision in decimal digits.

Equivalent to Python [`builtins.round(self, digits or 0)`](https://docs.python.org/3/library/functions.html#round).
Note that if `digits` is not specified, the behavior matches `builtins.round(self, 0)` rather than
`builtins.round(self)`; this ensures that the return type is always `float` (as in SQL) rather than `int`.


Built with [Mintlify](https://mintlify.com).