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

# LOG1P

> Returns the natural logarithm of one plus the input.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL for NULL input or input less than or equal to -1, including negative infinity.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
log1p(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE or DECIMAL(p, s) | Yes | The input added to one before taking the logarithm. For DECIMAL(p, s), p is precision (total digits) and s is scale (digits after the decimal point). |

## Returns

* Type: DOUBLE
* Possible values: Real logarithms for input greater than -1; NaN and positive infinity propagate.
* NULL behavior: Returns NULL for NULL input or input less than or equal to -1, including negative infinity.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | No |

* Approximation bound: No fixed maximum error is guaranteed.

## Usage notes

* The calculation preserves precision for values close to zero.
* INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
* Exact result: Floating-point computation can round the mathematical result.

## Examples

### Zero, domain boundary and NULL input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT log1p(0) AS "value", log1p(-1) AS domain_boundary, log1p(CAST(NULL AS DOUBLE)) AS null_value;
```

| value | domain\_boundary | null\_value |
| - | - | - |
| 0 | NULL | NULL |

### Positive and negative inputs

Results are rounded to six decimal places for display.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT round(log1p(CAST(1 AS DOUBLE)), 6) AS positive_input, round(log1p(CAST(-0.5 AS DOUBLE)), 6) AS negative_input;
```

| positive\_input | negative\_input |
| - | - |
| 0.693147 | -0.693147 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.