---
schema_version: "1"
id: 394cefd67336861b31d4fda738cbda136c9c4c5d43fb75b053cc93d5d9a2c248
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_saql/guides/reference/bi-saql-functions-math-log.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-math-log.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6dcecd134ae180893e9d39c7bd69b69c7dc2872a22927abc62db8e7c0f6c0be4
products:
  - Analytics SAQL 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 \<= 1e308 and m ≠ 1. The smallest value for _m_ or _n_ that will not produce 0 is log(10, 0.3e-323). This function can only be used in a `foreach` statement.

## Example

```nolang
q = foreach q generate log(10, Population) as Population;
q = filter q by log(10, Population) < 15;
```
