---
schema_version: "1"
id: 420999bdb5dd05c782401cd9a96f1dd578a533f01076986f674a3ca69c3cd384
title: log({m},{n})
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-math-log.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-log.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 827b2310a1a9d1e865835f011ff5bb985b3379c71b3a9066262f6615cb59c9e9
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# log({m},{n})

Returns the natural logarithm (base m) of a number n. The values m and n can be any positive, non-zero numeric value in the range 0 \< m, n \<= 1.797e308 and m ≠ 1.

`log({m}{n})` takes the following syntax.

```nolang
SELECT log(baseNumber, numericValue) as AliasName
FROM dataset;
```

## Example

This example returns the base 2 logarithm for the number 8.

```nolang
SELECT log(2.0,8.0) as natlLogExample FROM Superstore
LIMIT 1;
```

| natlLogExample |
| -------------- |
| 3.0            |
