# log {#log}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`log(X)`

## Arguments {#arguments}

**X** is a scalar/vector/pair/matrix/table.

**Y** \(optional\) is a positive number indicating the base.

## Details {#details}

-   If *Y* is not specified: return the natural logarithm of *X*.
-   If *Y* is specified: return the logarithm of X to base Y.

## Examples {#examples}

```
log(2.718283);
// output: 1
log(0 1 2 3);
// output: [,0,0.693147,1.098612]
log(100, 10)
// output: 2
```

