---
schema_version: "1"
id: d38c5445885eee82cb24e35a98007499531b454c4972eeb3070d31ba7a5e7061
title: Math Functions
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-intro.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-intro.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 18aea945814d991e9e8cae1b0ea02435976323f1d5e9554bd82fde0a4cc36d8b
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# Math Functions

SQL for CRM Analytics supports the following math functions.

- **[abs(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-abs.md)**


    Returns the absolute number of _n_ as a numeric value. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308.

- **[acos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-acos.md)**


    Returns the arccosine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `acos()` returns `null`.

- **[asin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-asin.md)**


    Returns the arcsine value of radians value `{n}`. `{n}` can be any real number in the range of -1 \<= `{n}` \<= 1. If `null` is passed as an argument, `sin()` returns `null`.

- **[atan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-atan.md)**


    Returns the arctan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `atan()` returns `null`.

- **[ceil(n), ceiling(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-ceil.md)**


    Returns the nearest integer of equal or greater value to _n_. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308.

- **[cos(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-cos.md)**


    Returns the cosine value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `cos()` returns `null`.

- **[degrees(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-degrees.md)**


    Returns the degrees value of `{n}` radians. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`.

- **[exp(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-exp.md)**


    Returns the value of Euler's number e raised to the power of _n_, where e = 2.71828183… The smallest value for _n_ that does not result in 0 is 3e-324. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 700.

- **[floor(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-floor.md)**


    Returns the nearest integer of equal or lesser value to n. n can be any real numeric value in the range of -1.797e308\<= n \<= 1.797e308.

- **[ln(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-ln.md)**


    Returns the base e (Euler's number) logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308.

- **[log(m,n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-log.md)**


    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.

- **[log10(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-log10.md)**


    Returns the base 10 logarithm of a number _n_. The value _n_ can be any positive, non-zero numeric value in the range 0 \< _n_ \<= 1.797e308.

- **[pi()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-pi.md)**


    Returns the value of constant π, where π=3.14159.

- **[power(m,n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-power.md)**


    Returns _m_ raised to the _n_th power. _m_, _n_ can be any numeric value in the range of -1.797e308 \<= _m_, _n_ \<= 1.797e308. Returns null if _m_ = 0 and _n_ \< 0.

- **[radians(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-radians.md)**


    Returns the radians value of `{n}` degrees. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `radians()` returns `null`.

- **[round(n[,m])](bi-sql-math-round.md)**


    Returns the value of _n_ rounded to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ rounded to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ rounded to the nearest integer. For tie-breaking, it follows round half way from zero convention. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15, inclusive.

- **[sign(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sign.md)**


    Returns 1 if the numeric value, `{n}` is positive. It returns -1 if the `{n}` is negative, and 0 if `{n}` is 0. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308.

- **[sin(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sin.md)**


    Returns the sine value of radians value `{n}`. `{n}`can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `sin()` returns `null`.

- **[sqrt(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-sqrt.md)**


    Returns the square root of a number _n_. The value _n_ can be any non-negative numeric value in the range of 0 \<= _n_ \<= 1.797e308.

- **[tan(n)](https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-math-tan.md)**


    Returns the tan value of radians value `{n}`. `{n}` can be any real number in the range of -1e308 \<= `{n}` \<= 1e308. If `null` is passed as an argument, `tan()` returns `null`.

- **[trunc(n[,m])](bi-sql-math-trunc.md)**


    Returns the value of the numeric expression _n_ truncated to _m_ decimal places. _m_ can be negative, in which case the function returns _n_ truncated to -_m_ places to the left of the decimal point. If _m_ is omitted, it returns _n_ truncated to the integer place. _n_ can be any real numeric value in the range of -1.797e308 \<= _n_ \<= 1.797e308. _m_ can be an integer value between -15 and 15 inclusive.
