The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite’s built-in math functions.
The math functions are not SQLite’s own built-in math functions. They come from a bundled extension that mirrors most of that set, with a few differences that matter when porting SQL.
log(x) is the natural logarithm. Use log10(x) for base 10. The two-argument form log(base, x) and log2(x) are not available.
ceil(), ceiling(), and floor() return an integer rather than a real.
power(x, y) is available, but pow(), trunc(), and mod() are not.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"bunny.net Documentation","colors":{"primary":"#EF6126","light":"#EF6126","dark":"#EF6126"},"logo":{"light":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37","dark":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-light.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3610e32d68a9fa458b0116ac58ca812a"},"favicon":"https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/favicon.png?fit=max\u0026auto=format\u0026n=1bTPx1eyQm8EK8W3\u0026q=85\u0026s=85267b63e804fac7a4dd94599bb8c6e8","navbar":{"links":[{"href":"https://bunny.net/docs/api-reference","label":"API Reference"},{"href":"https://github.com/BunnyWay","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.bunny.net/auth/register"}},"footer":{"socials":{"discord":"https://discord.gg/bunnynet","github":"https://github.com/BunnyWay","x":"https://x.com/BunnyCDN","bluesky":"https://bsky.app/profile/bunny.net","linkedin":"https://www.linkedin.com/company/bunnynet","facebook":"https://www.facebook.com/bunnycdn"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","claude","chatgpt","cursor","view","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bunnynet-cb9733c2","hasAudioNarration":false,"actualSubdomain":"bunnynet-cb9733c2","customDomains":["bunny.net"],"gitSource":{"type":"github","owner":"bunnyway","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae864361795b614d9d60c3d","collectionId":"dfb4e6c0-8bae-46f8-bc18-0f647559e867","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae864361795b614d9d60c3d"},"feedback":{"thumbs":true,"contextualFeedback":{"allowEmail":true},"agentFeedback":true,"edits":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae86453a2a5e46fe177f84b","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Documentation","count":766},{"language":"default","tag":"API Reference","count":318},{"language":"default","tag":"Core Platform API","count":109},{"language":"default","tag":"CDN","count":82},{"language":"default","tag":"Shield API","count":66},{"language":"default","tag":"Reference","count":66},{"language":"default","tag":"Stream","count":66},{"language":"default","tag":"Magic Containers API","count":56},{"language":"default","tag":"Storage","count":54},{"language":"default","tag":"Guides","count":54}],"searchSettings":{"isFiltersEnabled":true}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"type":"link","email":"support@bunny.net","url":"https://bunny.net/contact","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/logo/frameworks/angular.svg\"],.dark img[src*=\"/logo/frameworks/eleventy.svg\"],.dark img[src*=\"/logo/frameworks/express.svg\"],.dark img[src*=\"/logo/frameworks/mariadb.svg\"],.dark img[src*=\"/logo/frameworks/nextjs.svg\"],.dark img[src*=\"/logo/frameworks/sphinx.svg\"]{filter:invert(1)}html:not(.dark) img[src*=\"/logo/frameworks/zola.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"database/sql-extensions/mathematics","slug":"/database/sql-extensions/mathematics","pageMetadata":{"title":"Mathematics","description":"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite's built-in math functions.","href":"/database/sql-extensions/mathematics"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite’s built-in math functions.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The math functions are not SQLite’s own `,_jsx(_components.a,{href:`https://www.sqlite.org/lang_mathfunc.html`,children:`built-in math functions`}),`. They come from a bundled extension that mirrors most of that set, with a few differences that matter when porting SQL.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`log(x)`}),` is the `,_jsx(_components.strong,{children:`natural`}),` logarithm. Use `,_jsx(_components.code,{children:`log10(x)`}),` for base 10. The two-argument form `,_jsx(_components.code,{children:`log(base, x)`}),` and `,_jsx(_components.code,{children:`log2(x)`}),` are not available.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`ceil()`}),`, `,_jsx(_components.code,{children:`ceiling()`}),`, and `,_jsx(_components.code,{children:`floor()`}),` return an `,_jsx(_components.strong,{children:`integer`}),` rather than a real.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`power(x, y)`}),` is available, but `,_jsx(_components.code,{children:`pow()`}),`, `,_jsx(_components.code,{children:`trunc()`}),`, and `,_jsx(_components.code,{children:`mod()`}),` are not.`]}),`\n`]})}),`\n`,_jsx(Heading,{level:`2`,id:`functions`,children:`Functions`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Function`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`acos`}),`, `,_jsx(_components.code,{children:`acosh`}),`, `,_jsx(_components.code,{children:`asin`}),`, `,_jsx(_components.code,{children:`asinh`}),`, `,_jsx(_components.code,{children:`atan`}),`, `,_jsx(_components.code,{children:`atan2`}),`, `,_jsx(_components.code,{children:`atanh`})]}),_jsx(_components.td,{children:`Inverse trigonometric and hyperbolic functions, in radians.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cos`}),`, `,_jsx(_components.code,{children:`cosh`}),`, `,_jsx(_components.code,{children:`sin`}),`, `,_jsx(_components.code,{children:`sinh`}),`, `,_jsx(_components.code,{children:`tan`}),`, `,_jsx(_components.code,{children:`tanh`})]}),_jsx(_components.td,{children:`Trigonometric and hyperbolic functions.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cot(x)`}),`, `,_jsx(_components.code,{children:`coth(x)`})]}),_jsx(_components.td,{children:`Cotangent and hyperbolic cotangent.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`atn2(y, x)`})}),_jsxs(_components.td,{children:[`Alias of `,_jsx(_components.code,{children:`atan2()`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`exp(x)`}),`, `,_jsx(_components.code,{children:`ln(x)`}),`, `,_jsx(_components.code,{children:`log(x)`}),`, `,_jsx(_components.code,{children:`log10(x)`})]}),_jsxs(_components.td,{children:[`Exponential, natural logarithm (both `,_jsx(_components.code,{children:`ln`}),` and `,_jsx(_components.code,{children:`log`}),`), base-10 logarithm.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`power(x, y)`}),`, `,_jsx(_components.code,{children:`sqrt(x)`}),`, `,_jsx(_components.code,{children:`square(x)`})]}),_jsxs(_components.td,{children:[`Power, square root, and `,_jsx(_components.code,{children:`x`}),` multiplied by itself. `,_jsx(_components.code,{children:`power()`}),` returns a real.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ceil(x)`}),`, `,_jsx(_components.code,{children:`ceiling(x)`}),`, `,_jsx(_components.code,{children:`floor(x)`})]}),_jsx(_components.td,{children:`Rounding up and down. Return an integer.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`sign(x)`})}),_jsxs(_components.td,{children:[`-1, 0, or 1. Returns `,_jsx(_components.code,{children:`NULL`}),` for non-numeric input.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`degrees(x)`}),`, `,_jsx(_components.code,{children:`radians(x)`}),`, `,_jsx(_components.code,{children:`pi()`})]}),_jsx(_components.td,{children:`Angle conversion and the constant pi.`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- 4.60517 (natural log)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` log10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- 3.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` power`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- 1024.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` typeof(ceil(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- integer`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`edge-cases`,children:`Edge cases`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`sqrt()`}),` of a negative number returns `,_jsx(_components.code,{children:`NULL`}),`. Other domain errors, such as `,_jsx(_components.code,{children:`acos(2)`}),` or `,_jsx(_components.code,{children:`log(-1)`}),`, raise an error.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ln(0)`}),` raises an error.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Mathematics","description":"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite's built-in math functions.","href":"/database/sql-extensions/mathematics"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Functions","slug":"functions","depth":2,"children":[]},{"title":"Edge cases","slug":"edge-cases","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bunnynet-cb9733c2","siteName":"bunny.net Documentation","title":"Mathematics - bunny.net Documentation","relatedPagesConfig":{"enabled":false,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-02T10:18:10.764Z","gitLastModified":"2026-11-02T10:17:36.000Z","originalFileLocation":"database/sql-extensions/mathematics.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite\u0026#x27;s built-in math functions.\">\u003cmeta data-mint-head name=\"application-name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Mathematics - bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite\u0026#x27;s built-in math functions.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bunny.net/docs/database/sql-extensions/mathematics\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=SQL+Extensions\u0026amp;title=Mathematics\u0026amp;description=The+trigonometric%2C+logarithmic%2C+and+rounding+functions+available+in+Bunny+Database%2C+and+how+they+differ+from+SQLite%27s+built-in+math+functions.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=6ee2eb6246820db5389799382cbd7b06449d64992c03774496a386afa22d1458\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Mathematics - bunny.net Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite\u0026#x27;s built-in math functions.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=SQL+Extensions\u0026amp;title=Mathematics\u0026amp;description=The+trigonometric%2C+logarithmic%2C+and+rounding+functions+available+in+Bunny+Database%2C+and+how+they+differ+from+SQLite%27s+built-in+math+functions.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=6ee2eb6246820db5389799382cbd7b06449d64992c03774496a386afa22d1458\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EF6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bunny.net/docs/database/sql-extensions/mathematics\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/database/sql-extensions/mathematics.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bunny.net/#organization\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bunny.net/docs#website\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net/docs\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bunny.net/docs/database/sql-extensions/mathematics#webpage\",\"url\":\"https://bunny.net/docs/database/sql-extensions/mathematics\",\"name\":\"Mathematics\",\"description\":\"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite's built-in math functions.\",\"dateModified\":\"2026-11-02T10:17:36.000Z\",\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"},\"breadcrumb\":{\"@id\":\"https://bunny.net/docs/database/sql-extensions/mathematics#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bunny.net/docs/database/sql-extensions/mathematics#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://bunny.net/docs/database/limits\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Extensions\",\"item\":\"https://bunny.net/docs/database/sql-extensions/index\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Mathematics\",\"item\":\"https://bunny.net/docs/database/sql-extensions/mathematics\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bunny.net/docs/database/sql-extensions/mathematics#article\",\"headline\":\"Mathematics\",\"name\":\"Mathematics\",\"description\":\"The trigonometric, logarithmic, and rounding functions available in Bunny Database, and how they differ from SQLite's built-in math functions.\",\"url\":\"https://bunny.net/docs/database/sql-extensions/mathematics\",\"mainEntityOfPage\":{\"@id\":\"https://bunny.net/docs/database/sql-extensions/mathematics#webpage\"},\"dateModified\":\"2026-11-02T10:17:36.000Z\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"},\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bunny.net Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"bunny.net Documentation","nav":{"global":null,"products":[{"product":"Home","icon":"book-open","pages":[{"title":"Home","href":""}]},{"product":"CDN","icon":"zap","description":"Accelerate and protect your content globally","pages":[{"title":"CDN","href":"/cdn"}]},{"product":"Magic Containers","icon":"box","description":"Deploy any app anywhere with Docker","pages":[{"title":"Magic Containers","href":"/magic-containers"}]},{"product":"Edge Scripting","icon":"code","description":"Deploy serverless code at the edge","pages":[{"title":"Edge Scripting","href":"/scripting"}]},{"product":"Stream","icon":"video","description":"Video streaming and delivery platform","pages":[{"title":"Stream","href":"/stream"}]},{"product":"Storage","icon":"hard-drive","description":"Global object storage","pages":[{"title":"Storage","href":"/storage"}]},{"product":"Shield","icon":"shield","description":"Stay protected and online no matter what","pages":[{"title":"Shield","href":"/shield"}]},{"product":"Optimizer","icon":"sparkles","description":"Automatic image and web optimization.","pages":[{"title":"Optimizer","href":"/optimizer"}]},{"product":"DNS","icon":"globe","description":"Unlock the true power of DNS with an ultra-fast scriptable platform","pages":[{"title":"DNS","href":"/dns"}]},{"product":"Database","icon":"database","description":"Serverless SQLite over HTTP","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Bunny Database","sidebarTitle":"Introduction","mode":"wide","href":"/database"},{"title":"Quickstart","href":"/database/quickstart"},{"title":"Bunny Database Changelog","sidebarTitle":"Changelog","url":"/changelog?tags=Database","href":"/database/changelog"}]},{"group":"Connect","pages":[{"title":"Auth \u0026 Access","href":"/database/connect/authorization"},{"group":"SDKs","pages":[{"title":"TypeScript","href":"/database/connect/typescript"},{"title":"Go","href":"/database/connect/go"},{"title":"Rust","href":"/database/connect/rust"},{"title":".NET","href":"/database/connect/dotnet"}]},{"title":"Database Shell","href":"/database/connect/database-shell"},{"title":"SQL API","href":"/database/connect/sql-api"},{"title":"Bunny Edge Scripting","href":"/database/connect/scripting"},{"title":"Bunny Magic Containers","href":"/database/connect/magic-containers"}]},{"group":"Tools","pages":[{"title":"Bunny Database Client","sidebarTitle":"Database Client","href":"/database/tools/database-client"},{"title":"Database Migrations","sidebarTitle":"Migrations","href":"/database/migrations"}]},{"group":"Reference","pages":[{"title":"Limits","href":"/database/limits"},{"group":"SQL Extensions","pages":[{"title":"SQL Extensions and Functions","sidebarTitle":"Overview","href":"/database/sql-extensions/index"},{"title":"Full-Text Search","href":"/database/sql-extensions/full-text-search"},{"title":"Vector Search","href":"/database/sql-extensions/vector-search"},{"title":"Spatial Indexes and Geopoly","sidebarTitle":"Spatial","href":"/database/sql-extensions/spatial"},{"title":"JSON","href":"/database/sql-extensions/json"},{"title":"Regular Expressions","href":"/database/sql-extensions/regular-expressions"},{"title":"Identifiers and Hashing","description":"Generate UUIDs and compute SHA-3 hashes in SQL with the uuid and sha3 functions in Bunny Database.","href":"/database/sql-extensions/identifiers-and-hashing"},{"title":"Mathematics","href":"/database/sql-extensions/mathematics"},{"title":"Statistics and Text Functions","sidebarTitle":"Statistics and text","description":"Median, quartile, mode, and deviation aggregates plus string helper functions available in Bunny Database.","href":"/database/sql-extensions/statistics-and-text"},{"title":"Sequences","href":"/database/sql-extensions/sequences"},{"title":"Introspection","href":"/database/sql-extensions/introspection"},{"title":"Syntax Extensions","href":"/database/sql-extensions/syntax-extensions"},{"title":"Connection Settings and Limits","sidebarTitle":"Connection settings","href":"/database/sql-extensions/connection-settings"},{"title":"Core SQLite Functions and Features","sidebarTitle":"Core functions","href":"/database/sql-extensions/core-functions"}]},{"title":"Replication","href":"/database/replication"},{"title":"Metrics","href":"/database/metrics"},{"title":"Durability and Consistency","href":"/database/durability-and-consistency"}]}]}]},{"product":"Integrations","icon":"puzzle","description":"Official and third-party plugins and integrations","pages":[{"title":"Integrations","href":"/integrations/wordpress"}]},{"product":"CLI","icon":"terminal","description":"Manage bunny.net from your terminal","pages":[{"title":"CLI","href":"/cli"}]},{"product":"API Reference","icon":"square-terminal","description":"Build \u0026 Integrate with the Platform API","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Partners","icon":"handshake","description":"Manage customers, pricing, and billing as a bunny.net partner","pages":[{"title":"Partners","href":"/partners"}]}]},"basePath":"","title":"Mathematics - bunny.net Documentation","buildId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","deploymentId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","dynamics":[],"chunks":[]}