> This page location: Math Functions > ABS
> Full Neon documentation index: https://neon.com/docs/llms.txt

# PostgreSQL ABS() Function

The PostgreSQL `ABS()` function returns the absolute value of a number.

## Syntax

The following illustrates the syntax of the `ABS()` function:

```sql
ABS(numeric_expression)
```

## Arguments

The `ABS()` function requires one argument:

1) `numeric_expression`

The `numeric_expression` can be a number or a numeric expression that evaluates to a number.

## Return Value

The `ABS()` function returns a value whose [data type](../postgresql-tutorial/postgresql-time) is the same as the input argument.

## Absolute Operator @

Besides the ABS() function, you can use the absolute operator @:

```sql
@ expression
```

In this syntax, the `@` operator returns the absolute value of the `expression`.

## Examples

The following example shows how to use the `ABS()` function to calculate the absolute value of a number:

```sql
SELECT ABS(-10.25) result;
```

The result is:

```
 result
--------
  10.25
(1 row)

```

The following statement uses an expression for the `ABS()` function:

```sql
SELECT ABS( 100 - 250 ) result;
```

Here is the result:

```
 result
--------
    150
(1 row)
```

Besides the `ABS()` function, you can use the absolute operator `@`, for example:

```sql
SELECT @ -15 as result
```

It returned 15 as expected.

```
 result
--------
     15
(1 row)
```

In this tutorial, you have learned how to use the PostgreSQL `ABS()` function to calculate the absolute value of a number.

---

## Related docs (Math Functions)

- [CBRT](https://neon.com/postgresql/postgresql-math-functions/postgresql-cbrt)
- [CEIL](https://neon.com/postgresql/postgresql-math-functions/postgresql-ceil)
- [DEGREES](https://neon.com/postgresql/postgresql-math-functions/postgresql-degrees)
- [DIV](https://neon.com/postgresql/postgresql-math-functions/postgresql-div)
- [EXP](https://neon.com/postgresql/postgresql-math-functions/postgresql-exp)
- [FACTORIAL](https://neon.com/postgresql/postgresql-math-functions/postgresql-factorial)
- [FLOOR](https://neon.com/postgresql/postgresql-math-functions/postgresql-floor)
- [GCD](https://neon.com/postgresql/postgresql-math-functions/postgresql-gcd)
- [LCM](https://neon.com/postgresql/postgresql-math-functions/postgresql-lcm)
- [LN](https://neon.com/postgresql/postgresql-math-functions/postgresql-ln)
- [LOG](https://neon.com/postgresql/postgresql-math-functions/postgresql-log)
- [MOD](https://neon.com/postgresql/postgresql-math-functions/postgresql-mod)
- [MIN_SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-min_scale)
- [PI](https://neon.com/postgresql/postgresql-math-functions/postgresql-pi-function)
- [POWER](https://neon.com/postgresql/postgresql-math-functions/postgresql-power)
- [RADIANS](https://neon.com/postgresql/postgresql-math-functions/postgresql-radians)
- [RANDOM](https://neon.com/postgresql/postgresql-math-functions/postgresql-random)
- [ROUND](https://neon.com/postgresql/postgresql-math-functions/postgresql-round)
- [SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-scale)
- [SIGN](https://neon.com/postgresql/postgresql-math-functions/postgresql-sign)
- [SQRT](https://neon.com/postgresql/postgresql-math-functions/postgresql-sqrt)
- [TRIM_SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-trim_scale)
- [TRUNC](https://neon.com/postgresql/postgresql-math-functions/postgresql-trunc)
- [WIDTH_BUCKET](https://neon.com/postgresql/postgresql-math-functions/postgresql-width_bucket)
