Mathematical functions
Last updated Apr 23, 2026
intDiv
Usage:
intDiv(a, b)
Divide a by b, rounding the answer down to the nearest whole number.
log New
Usage:
log(<expression>)
log returns the natural logarithm of a provided number. ln is also available as an alias.
Examples:
-- get the natural logarithm of the double1 column
log(double1)
pow New
Usage:
pow(<expression>, <expression>)
pow returns the first argument raised to the power of the second argument.
Examples:
-- get the square of the double1 column
pow(double1, 2)
round New
Usage:
round(<expression>[, n])
round returns a number rounded to the nearest whole number, or to a given number of decimal points specified by the second argument.
Examples:
-- round 5.5 to 6
round(5.5)
-- round 3.14 to 3.1
round(3.14, 1)
floor New
Usage:
floor(<expression>[, n])
floor returns a number rounded down to a whole number, or rounded down to a given number of decimal points specified by the second argument.
Examples:
-- round down 5.5 to 5
floor(5.5)
-- round down 3.14 to 3.1
floor(3.14, 1)
ceil New
Usage:
ceil(<expression>[, n])
ceil returns a number rounded up to a whole number, or rounded up to a given number of decimal points specified by the second argument.
Examples:
-- round up 5.5 to 6
ceil(5.5)
-- round up 3.14 to 3.2
ceil(3.14, 1)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/analytics/analytics-engine/sql-reference/mathematical-functions/#page","headline":"Mathematical functions","description":"Mathematical SQL functions for Analytics Engine.","url":"https://developers.cloudflare.com/analytics/analytics-engine/sql-reference/mathematical-functions/","inLanguage":"en","image":"https://developers.cloudflare.com/analytics/analytics-engine/sql-reference/mathematical-functions/og.png?v=029d44160f4880b7","dateModified":"2026-04-23","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Arithmetic, comparison, and logical SQL operators. title: Operators image: https://developers.cloudflare.com/analytics/analytics-engine/sql-reference/operators/og.png?v=7988826db27eee17
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/analytics/llms.txt
Use this file to discover all available pages before exploring further.
Docs