CINXE.COM
Numbers in Dart | Dart
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><script>!function(e,t,a,n){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var g=t.getElementsByTagName(a)[0],m=t.createElement(a);m.async=!0,m.src="https://www.googletagmanager.com/gtm.js?id=GTM-5VSZM5J",g.parentNode.insertBefore(m,g)}(window,document,"script","dataLayer")</script><meta name="description" content="Learn how Dart numbers are slightly different on the web, when that might matter, and how you might adjust your code."><title>Numbers in Dart | Dart</title><link rel="icon" sizes="64x64" href="/assets/img/logo/dart-64.png" eleventy:ignore><link href="/assets/img/touch-icon-iphone.png" rel="apple-touch-icon" eleventy:ignore><link href="/assets/img/touch-icon-ipad.png" rel="apple-touch-icon" sizes="152x152" eleventy:ignore><link href="/assets/img/touch-icon-iphone-retina.png" rel="apple-touch-icon" sizes="180x180" eleventy:ignore><link href="/assets/img/touch-icon-ipad-retina.png" rel="apple-touch-icon" sizes="167x167" eleventy:ignore><meta name="twitter:card" content="summary"><meta name="twitter:site" content="@dart_lang"><meta name="twitter:title" content="Numbers in Dart"><meta name="twitter:description" content="Learn how Dart numbers are slightly different on the web, when that might matter, and how you might adjust your code."><meta property="og:title" content="Numbers in Dart"><meta property="og:description" content="Learn how Dart numbers are slightly different on the web, when that might matter, and how you might adjust your code."><meta property="og:url" content="/guides/language/numbers/"><meta property="og:image" content="/assets/img/logo/dart-logo-for-shares.png?2" eleventy:ignore><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Google+Sans+Display:wght@400&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Google+Sans+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Google+Sans+Text:wght@400;500;700&display=swap" rel="stylesheet"><link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet"><link rel="stylesheet" href="/assets/css/main.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous" referrerpolicy="no-referrer"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.min.js" integrity="sha512-nlp9/l96/EpjYBx7EP7pGASVXNe80hGhYAUrjeXnu/fyF5Py0/RXav4BBNs7n5Hx1WFhOEOWSAVjGeC3oKxDVQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script><script src="/assets/js/os-tabs.js"></script><script src="/assets/js/utilities.js"></script><script src="/assets/js/main.js"></script><script>!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga"),ga("create","UA-26406144-4","auto"),ga("send","pageview")</script></head><body class="default.html show_banner"><a id="skip" href="#site-content-title">Skip to main content</a><section id="cookie-notice"><div class="container"><p>dart.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic. <a href="https://policies.google.com/technologies/cookies" target="_blank" rel="noopener">Learn more</a>.</p><button id="cookie-consent" class="btn btn-primary">OK, got it</button></div></section><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5VSZM5J" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><header id="page-header" class="site-header"><nav id="mainnav" class="site-header"><div id="menu-toggle"><i class="material-symbols">menu</i></div><a href="/" class="brand" title="Dart"><img src="/assets/img/logo/logo-white-text.svg" alt="Dart"></a><ul class="navbar"><li><a href="/overview" class="nav-link">Overview</a></li><li class="mainnav__get-started"><a href="/guides" class="nav-link active"><span>Docs</span></a></li><li><a href="/community" class="nav-link">Community</a></li><li><a href="/#try-dart" class="nav-link">Try Dart</a></li><li><a href="/get-dart" class="nav-link">Get Dart</a></li><li class="searchfield"><form action="/search" class="site-header__search form-inline" id="cse-search-box"><input type="hidden" name="cx" value="011220921317074318178:_yy-tmb5t_i"> <input type="hidden" name="ie" value="UTF-8"> <input type="hidden" name="hl" value="en"> <input class="site-header__searchfield form-control search-field" type="search" name="q" id="search-main" autocomplete="off" placeholder="Search" aria-label="Search"></form></li></ul></nav></header><div class="banner"><p class="banner__text">Announcing Dart 3.5 and an updated Dart roadmap! <a href="https://medium.com/dartlang/dart-3-5-6ca36259fa2f" target="_blank">Learn more</a></p></div><div id="sidenav"><form action="/search/" class="site-header__search form-inline"><input class="site-header__searchfield form-control search-field" type="search" name="q" id="search-side" autocomplete="off" placeholder="Search" aria-label="Search"></form><div class="site-sidebar"><ul class="navbar-nav"><li class="nav-item"><a href="/overview" class="nav-link">Overview</a></li><li class="nav-item"><a href="/community" class="nav-link">Community</a></li><li class="nav-item"><a href="https://dartpad.dev" class="nav-link">Try Dart</a></li><li class="nav-item"><a href="/get-dart" class="nav-link">Get Dart</a></li><li class="nav-item"><a href="/guides" class="nav-link">Docs</a></li><li aria-hidden="true"><div class="sidebar-primary-divider"></div></li></ul><ul class="nav flex-column"><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-1" role="button" aria-expanded="false" aria-controls="sidenav-1">Language</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1"><li class="nav-item"><a class="nav-link" href="/language">Introduction</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-2" href="#sidenav-1-2" role="button" aria-expanded="false" aria-controls="sidenav-1-2">Syntax basics</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-2"><li class="nav-item"><a class="nav-link" href="/language/variables">Variables</a></li><li class="nav-item"><a class="nav-link" href="/language/operators">Operators</a></li><li class="nav-item"><a class="nav-link" href="/language/comments">Comments</a></li><li class="nav-item"><a class="nav-link" href="/language/metadata">Metadata</a></li><li class="nav-item"><a class="nav-link" href="/language/libraries">Libraries & imports</a></li><li class="nav-item"><a class="nav-link" href="/language/keywords">Keywords</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-3" href="#sidenav-1-3" role="button" aria-expanded="false" aria-controls="sidenav-1-3">Types</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-3"><li class="nav-item"><a class="nav-link" href="/language/built-in-types">Built-in types</a></li><li class="nav-item"><a class="nav-link" href="/language/records">Records</a></li><li class="nav-item"><a class="nav-link" href="/language/collections">Collections</a></li><li class="nav-item"><a class="nav-link" href="/language/generics">Generics</a></li><li class="nav-item"><a class="nav-link" href="/language/typedefs">Typedefs</a></li><li class="nav-item"><a class="nav-link" href="/language/type-system">Type system</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-4" href="#sidenav-1-4" role="button" aria-expanded="false" aria-controls="sidenav-1-4">Patterns</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-4"><li class="nav-item"><a class="nav-link" href="/language/patterns">Overview & usage</a></li><li class="nav-item"><a class="nav-link" href="/language/pattern-types">Pattern types</a></li><li class="nav-item"><a class="nav-link" href="https://codelabs.developers.google.com/codelabs/dart-patterns-records" target="_blank" rel="noopener">Applied tutorial</a></li></ul></li><li class="nav-item"><a class="nav-link" href="/language/functions">Functions</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-6" href="#sidenav-1-6" role="button" aria-expanded="false" aria-controls="sidenav-1-6">Control flow</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-6"><li class="nav-item"><a class="nav-link" href="/language/loops">Loops</a></li><li class="nav-item"><a class="nav-link" href="/language/branches">Branches</a></li><li class="nav-item"><a class="nav-link" href="/language/error-handling">Error handling</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-7" href="#sidenav-1-7" role="button" aria-expanded="false" aria-controls="sidenav-1-7">Classes & objects</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-7"><li class="nav-item"><a class="nav-link" href="/language/classes">Classes</a></li><li class="nav-item"><a class="nav-link" href="/language/constructors">Constructors</a></li><li class="nav-item"><a class="nav-link" href="/language/methods">Methods</a></li><li class="nav-item"><a class="nav-link" href="/language/extend">Extend a class</a></li><li class="nav-item"><a class="nav-link" href="/language/mixins">Mixins</a></li><li class="nav-item"><a class="nav-link" href="/language/enums">Enums</a></li><li class="nav-item"><a class="nav-link" href="/language/extension-methods">Extension methods</a></li><li class="nav-item"><a class="nav-link" href="/language/extension-types">Extension types</a></li><li class="nav-item"><a class="nav-link" href="/language/callable-objects">Callable objects</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-8" href="#sidenav-1-8" role="button" aria-expanded="false" aria-controls="sidenav-1-8">Class modifiers</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-8"><li class="nav-item"><a class="nav-link" href="/language/class-modifiers">Overview & usage</a></li><li class="nav-item"><a class="nav-link" href="/language/class-modifiers-for-apis">Class modifiers for API maintainers</a></li><li class="nav-item"><a class="nav-link" href="/language/modifier-reference">Reference</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-9" href="#sidenav-1-9" role="button" aria-expanded="false" aria-controls="sidenav-1-9">Concurrency</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-9"><li class="nav-item"><a class="nav-link" href="/language/concurrency">Overview</a></li><li class="nav-item"><a class="nav-link" href="/language/async">Asynchronous support</a></li><li class="nav-item"><a class="nav-link" href="/language/isolates">Isolates</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-1-10" href="#sidenav-1-10" role="button" aria-expanded="false" aria-controls="sidenav-1-10">Null safety</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-1-10"><li class="nav-item"><a class="nav-link" href="/null-safety">Sound null safety</a></li><li class="nav-item"><a class="nav-link" href="/null-safety/migration-guide">Migrating to null safety</a></li><li class="nav-item"><a class="nav-link" href="/null-safety/understanding-null-safety">Understanding null safety</a></li><li class="nav-item"><a class="nav-link" href="/null-safety/unsound-null-safety">Unsound null safety</a></li><li class="nav-item"><a class="nav-link" href="/null-safety/faq">FAQ</a></li></ul></li></ul></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-2" role="button" aria-expanded="false" aria-controls="sidenav-2">Core libraries</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-2"><li class="nav-item"><a class="nav-link" href="/libraries">Overview</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-core">dart:core</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-async">dart:async</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-math">dart:math</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-convert">dart:convert</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-io">dart:io</a></li><li class="nav-item"><a class="nav-link" href="/libraries/dart-html">dart:html</a></li><div class="dropdown-divider"></div><li class="nav-item"><a class="nav-link" href="/libraries/collections/iterables">Iterable collections</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-2-10" href="#sidenav-2-10" role="button" aria-expanded="false" aria-controls="sidenav-2-10">Asynchronous programming</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-2-10"><li class="nav-item"><a class="nav-link" href="/libraries/async/async-await">Tutorial</a></li><li class="nav-item"><a class="nav-link" href="/libraries/async/futures-error-handling">Futures and error handling</a></li><li class="nav-item"><a class="nav-link" href="/libraries/async/using-streams">Using streams</a></li><li class="nav-item"><a class="nav-link" href="/libraries/async/creating-streams">Creating streams</a></li></ul></li></ul></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-3" role="button" aria-expanded="false" aria-controls="sidenav-3">Effective Dart</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-3"><li class="nav-item"><a class="nav-link" href="/effective-dart">Overview</a></li><li class="nav-item"><a class="nav-link" href="/effective-dart/style">Style</a></li><li class="nav-item"><a class="nav-link" href="/effective-dart/documentation">Documentation</a></li><li class="nav-item"><a class="nav-link" href="/effective-dart/usage">Usage</a></li><li class="nav-item"><a class="nav-link" href="/effective-dart/design">Design</a></li></ul></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-4" role="button" aria-expanded="false" aria-controls="sidenav-4">Packages</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-4"><li class="nav-item"><a class="nav-link" href="/tools/pub/packages">How to use packages</a></li><li class="nav-item"><a class="nav-link" href="/resources/useful-packages">Commonly used packages</a></li><li class="nav-item"><a class="nav-link" href="/guides/libraries/create-packages">Creating packages</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/publishing">Publishing packages</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/writing-package-pages">Writing package pages</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-4-6" href="#sidenav-4-6" role="button" aria-expanded="false" aria-controls="sidenav-4-6">Package reference</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-4-6"><li class="nav-item"><a class="nav-link" href="/tools/pub/dependencies">Dependencies</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/glossary">Glossary</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/package-layout">Package layout conventions</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/environment-variables">Pub environment variables</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/pubspec">Pubspec file</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/troubleshoot">Troubleshooting pub</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/verified-publishers">Verified publishers</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/security-advisories">Security advisories</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/versioning">Versioning</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/custom-package-repositories">Custom package repositories</a></li></ul></li><li class="nav-item"><a class="nav-link" href="/guides/libraries/private-files">What not to commit</a></li></ul></li><li class="nav-item"><a class="nav-link active collapsible" data-toggle="collapse" href="#sidenav-5" role="button" aria-expanded="true" aria-controls="sidenav-5">Development</a><ul class="nav flex-column flex-nowrap collapse show" id="sidenav-5"><li class="nav-item"><a class="nav-link" href="/guides/json">JSON</a></li><li class="nav-item"><a class="nav-link active" href="/guides/language/numbers">Number representation</a></li><li class="nav-item"><a class="nav-link" href="/resources/google-apis">Google APIs</a></li><li class="nav-item"><a class="nav-link" href="/multiplatform-apps">Multi-platform apps</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-5-5" href="#sidenav-5-5" role="button" aria-expanded="false" aria-controls="sidenav-5-5">Command-line & server apps</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-5-5"><li class="nav-item"><a class="nav-link" href="/server">Overview</a></li><li class="nav-item"><a class="nav-link" href="/tutorials/server/get-started">Get started</a></li><li class="nav-item"><a class="nav-link" href="/tutorials/server/cmdline">Write command-line apps</a></li><li class="nav-item"><a class="nav-link" href="/tutorials/server/fetch-data">Fetch data from the internet</a></li><li class="nav-item"><a class="nav-link" href="/tutorials/server/httpserver">Write HTTP servers</a></li><li class="nav-item"><a class="nav-link" href="/server/libraries">Libraries & packages</a></li><li class="nav-item"><a class="nav-link" href="/server/google-cloud">Google Cloud</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-5-6" href="#sidenav-5-6" role="button" aria-expanded="false" aria-controls="sidenav-5-6">Web apps</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-5-6"><li class="nav-item"><a class="nav-link" href="/web">Overview</a></li><li class="nav-item"><a class="nav-link" href="/web/get-started">Get started</a></li><li class="nav-item"><a class="nav-link" href="/web/deployment">Deployment</a></li><li class="nav-item"><a class="nav-link" href="/web/libraries">Libraries & packages</a></li><li class="nav-item"><a class="nav-link" href="/web/wasm">Wasm compilation</a></li></ul></li><li class="nav-item"><a class="nav-link" href="/guides/environment-declarations">Environment declarations</a></li></ul></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-6" role="button" aria-expanded="false" aria-controls="sidenav-6">Interoperability</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-6"><li class="nav-item"><a class="nav-link" href="/interop/c-interop">C interop</a></li><li class="nav-item"><a class="nav-link" href="/interop/objective-c-interop">Objective-C & Swift interop</a></li><li class="nav-item"><a class="nav-link" href="/interop/java-interop">Java & Kotlin interop</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-6-4" href="#sidenav-6-4" role="button" aria-expanded="false" aria-controls="sidenav-6-4">JavaScript interop</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-6-4"><li class="nav-item"><a class="nav-link" href="/interop/js-interop">Overview</a></li><li class="nav-item"><a class="nav-link" href="/interop/js-interop/usage">Usage</a></li><li class="nav-item"><a class="nav-link" href="/interop/js-interop/js-types">JS types</a></li><li class="nav-item"><a class="nav-link" href="/interop/js-interop/tutorials">Tutorials</a></li><li class="nav-item"><a class="nav-link" href="/interop/js-interop/past-js-interop">Past JS interop</a></li><div class="dropdown-divider"></div><li class="nav-item"><a class="nav-link" href="/interop/js-interop/package-web">Web interop</a></li></ul></li></ul></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-7" role="button" aria-expanded="false" aria-controls="sidenav-7">Tools & techniques</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7"><li class="nav-item"><a class="nav-link" href="/tools">Overview</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-7-2" href="#sidenav-7-2" role="button" aria-expanded="false" aria-controls="sidenav-7-2">Editors & debuggers</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7-2"><li class="nav-item"><a class="nav-link" href="/tools/jetbrains-plugin">IntelliJ & Android Studio</a></li><li class="nav-item"><a class="nav-link" href="/tools/vs-code">VS Code</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-devtools">Dart DevTools</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-7-2-4" href="#sidenav-7-2-4" role="button" aria-expanded="false" aria-controls="sidenav-7-2-4">DartPad</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7-2-4"><li class="nav-item"><a class="nav-link" href="/tools/dartpad">Overview</a></li><li class="nav-item"><a class="nav-link" href="/tools/dartpad/troubleshoot">Troubleshooting DartPad</a></li></ul></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-7-3" href="#sidenav-7-3" role="button" aria-expanded="false" aria-controls="sidenav-7-3">Command-line tools</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7-3"><li class="nav-item"><a class="nav-link collapsible" data-toggle="collapse" data-target="#sidenav-7-3-1" href="#sidenav-7-3-1" role="button" aria-expanded="true" aria-controls="sidenav-7-3-1">Dart SDK</a><ul class="nav flex-column flex-nowrap collapse show" id="sidenav-7-3-1"><li class="nav-item"><a class="nav-link" href="/tools/sdk">Overview</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-tool">dart</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-analyze">dart analyze</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-compile">dart compile</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-create">dart create</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-doc">dart doc</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-fix">dart fix</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-format">dart format</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-info">dart info</a></li><li class="nav-item"><a class="nav-link" href="/tools/pub/cmd">dart pub</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-run">dart run</a></li><li class="nav-item"><a class="nav-link" href="/tools/dart-test">dart test</a></li><li class="nav-item"><a class="nav-link" href="/tools/dartaotruntime">dartaotruntime</a></li><li class="nav-item"><a class="nav-link" href="/tools/experiment-flags">Experiment flags</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible" data-toggle="collapse" data-target="#sidenav-7-3-2" href="#sidenav-7-3-2" role="button" aria-expanded="true" aria-controls="sidenav-7-3-2">Other command-line tools</a><ul class="nav flex-column flex-nowrap collapse show" id="sidenav-7-3-2"><li class="nav-item"><a class="nav-link" href="/tools/build_runner">build_runner</a></li><li class="nav-item"><a class="nav-link" href="/tools/webdev">webdev</a></li></ul></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-7-4" href="#sidenav-7-4" role="button" aria-expanded="false" aria-controls="sidenav-7-4">Static analysis</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7-4"><li class="nav-item"><a class="nav-link" href="/tools/analysis">Customizing static analysis</a></li><li class="nav-item"><a class="nav-link" href="/guides/language/sound-problems">Fixing common type problems</a></li><li class="nav-item"><a class="nav-link" href="/tools/non-promotion-reasons">Fixing type promotion failures</a></li><li class="nav-item"><a class="nav-link" href="/tools/linter-rules">Linter rules</a></li><li class="nav-item"><a class="nav-link" href="/tools/diagnostic-messages">Diagnostic messages</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-7-5" href="#sidenav-7-5" role="button" aria-expanded="false" aria-controls="sidenav-7-5">Testing & optimization</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-7-5"><li class="nav-item"><a class="nav-link" href="/guides/testing">Testing</a></li><li class="nav-item"><a class="nav-link" href="/web/debugging">Debugging web apps</a></li></ul></li></ul></li><li aria-hidden="true"><div class="sidebar-primary-divider"></div></li><li class="nav-item"><a class="nav-link collapsed collapsible" data-toggle="collapse" href="#sidenav-9" role="button" aria-expanded="false" aria-controls="sidenav-9">Resources</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-9"><li class="nav-item"><a class="nav-link" href="/resources/dart-cheatsheet">Language cheatsheet</a></li><li class="nav-item"><a class="nav-link" href="/resources/breaking-changes">Breaking changes</a></li><li class="nav-item"><a class="nav-link" href="/guides/language/evolution">Language evolution</a></li><li class="nav-item"><a class="nav-link" href="/guides/language/spec">Language specification</a></li><li class="nav-item"><a class="nav-link" href="/resources/dart-3-migration">Dart 3 migration guide</a></li><li class="nav-item"><a class="nav-link collapsible collapsed" data-toggle="collapse" data-target="#sidenav-9-6" href="#sidenav-9-6" role="button" aria-expanded="false" aria-controls="sidenav-9-6">Coming from ...</a><ul class="nav flex-column flex-nowrap collapse" id="sidenav-9-6"><li class="nav-item"><a class="nav-link" href="/resources/coming-from/js-to-dart">JavaScript to Dart</a></li><li class="nav-item"><a class="nav-link" href="/resources/coming-from/swift-to-dart">Swift to Dart</a></li></ul></li><div class="dropdown-divider"></div><li class="nav-item"><a class="nav-link" href="/resources/faq">FAQ</a></li><li class="nav-item"><a class="nav-link" href="/resources/glossary">Glossary</a></li><li class="nav-item"><a class="nav-link" href="/resources/books">Books</a></li><li class="nav-item"><a class="nav-link" href="/resources/videos">Videos</a></li><li class="nav-item"><a class="nav-link" href="/tutorials">Tutorials</a></li></ul></li><li class="nav-item"><a class="nav-link collapsible" data-toggle="collapse" href="#sidenav-10" role="button" aria-expanded="true" aria-controls="sidenav-10">Related sites</a><ul class="nav flex-column flex-nowrap collapse show" id="sidenav-10"><li class="nav-item"><a class="nav-link" href="https://api.dart.dev" target="_blank" rel="noopener">API reference</a></li><li class="nav-item"><a class="nav-link" href="https://medium.com/dartlang" target="_blank" rel="noopener">Blog</a></li><li class="nav-item"><a class="nav-link" href="https://dartpad.dev" target="_blank" rel="noopener">DartPad (online editor)</a></li><li class="nav-item"><a class="nav-link" href="https://flutter.dev" target="_blank" rel="noopener">Flutter</a></li><li class="nav-item"><a class="nav-link" href="https://pub.dev" target="_blank" rel="noopener">Package site</a></li></ul></li></ul></div></div><main id="page-content"><div id="site-toc--side" class="site-toc"><header class="site-toc__title">Contents</header><ul class="section-nav"><li class="toc-entry nav-item"><a class="nav-link" href="#dart-number-representation">Dart number representation</a></li><li class="toc-entry nav-item"><a class="nav-link" href="#differences-in-behavior">Differences in behavior</a><ul class="nav"><li class="toc-entry nav-item"><a class="nav-link" href="#precision">Precision</a></li><li class="toc-entry nav-item"><a class="nav-link" href="#identity">Identity</a></li><li class="toc-entry nav-item"><a class="nav-link" href="#types-and-type-checking">Types and type checking</a></li><li class="toc-entry nav-item"><a class="nav-link" href="#bitwise-operations">Bitwise operations</a></li><li class="toc-entry nav-item"><a class="nav-link" href="#string-representation">String representation</a></li></ul></li><li class="toc-entry nav-item"><a class="nav-link" href="#what-should-you-do">What should you do?</a></li></ul></div><article><div class="content"><div id="site-content-title"><h1>Numbers in Dart</h1></div><div id="site-toc--inline" class="site-toc"><header class="site-toc__title">Contents</header><ul class="section-nav"><li class="toc-entry"><a href="#dart-number-representation">Dart number representation</a></li><li class="toc-entry"><a href="#differences-in-behavior">Differences in behavior</a><ul><li class="toc-entry"><a href="#precision">Precision</a></li><li class="toc-entry"><a href="#identity">Identity</a></li><li class="toc-entry"><a href="#types-and-type-checking">Types and type checking</a></li><li class="toc-entry"><a href="#bitwise-operations">Bitwise operations</a></li><li class="toc-entry"><a href="#string-representation">String representation</a></li></ul></li><li class="toc-entry"><a href="#what-should-you-do">What should you do?</a></li></ul></div><p>Dart apps often target multiple platforms. For example, a Flutter app might target iOS, Android, and the web. The code can be the same, as long as the app doesn't rely on platform-specific libraries or use numbers in a way that's platform dependent.</p><p>This page has details about the differences between native and web number implementations, and how to write code so that those differences don't matter.</p><aside class="alert alert-secondary"><div class="alert-header"><span>Number implementations in Dart and other languages</span></div><div class="alert-content"><p>Dart has always allowed platform-specific representations and semantics for numbers, for reasons of performance, code size, and platform interoperability.</p><p>Similarly, in C/C++ the commonly used <code>int</code> type for integer values is platform-specific to best map to the native machine architecture (16-, 32-, or 64-bit). In Java, the <code>float</code> and <code>double</code> types for fractional values were originally designed to strictly follow IEEE 754 on all platforms, but this constraint was loosened almost immediately for efficiency reasons (<code>strictfp</code> is required for exact coherence).</p></div></aside><div class="header-wrapper"><h2 id="dart-number-representation">Dart number representation</h2><a class="heading-link" href="#dart-number-representation" aria-label="Link to 'Dart number representation' section">#</a></div><p>In Dart, all numbers are part of the common <code>Object</code> type hierarchy, and there are two concrete, user-visible numeric types: <code>int</code>, representing integer values, and <code>double</code>, representing fractional values.</p><p><img src="/assets/img/number-class-hierarchy.svg" alt="Object is the parent of num, which is the parent of int and double"></p><p>Depending on the platform, those numeric types have different, hidden implementations. In particular, Dart has two very different types of targets it compiles to:</p><ul><li><strong>Native:</strong> Most often, a 64-bit mobile or desktop processor.</li><li><strong>Web:</strong> JavaScript as the primary execution engine.</li></ul><p>The following table shows how Dart numbers are usually implemented:</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Representation</th><th>Native <code>int</code></th><th>Native <code>double</code></th><th>Web <code>int</code></th><th>Web <code>double</code></th></tr><tr><td><a href="https://en.wikipedia.org/wiki/Two%27s_complement">64-bit signed two's complement</a></td><td>✅</td><td></td><td></td><td></td></tr><tr><td><a href="https://en.wikipedia.org/wiki/Double-precision_floating-point_format">64-bit floating point</a></td><td></td><td>✅</td><td>✅</td><td>✅</td></tr></table></div><p>For native targets, you can assume that <code>int</code> maps to a signed 64-bit integer representation and <code>double</code> maps to a 64-bit IEEE floating-point representation that matches the underlying processor.</p><p>But on the web, where Dart compiles to and interoperates with JavaScript, there is a single numeric representation: a 64-bit double-precision floating-point value. For efficiency, Dart maps both <code>int</code> and <code>double</code> to this single representation. The visible type hierarchy remains the same, but the underlying hidden implementation types are different and intertwined.</p><p>The following figure illustrates the platform-specific types (in blue) for native and web targets. As the figure shows, the concrete type for <code>int</code> on native implements only the <code>int</code> interface. However, the concrete type for <code>int</code> on the web implements both <code>int</code> and <code>double</code>.</p><p><img src="/assets/img/number-platform-specific.svg" alt="Implementation classes vary by platform; for JavaScript, the class that implements int also implements double"></p><aside class="alert alert-info"><div class="alert-header"><i class="material-symbols" aria-hidden="true">info</i> <span>Note</span></div><div class="alert-content"><p>Dart represents <code>int</code> and <code>double</code> in a few different ways for efficiency, but these implementation classes (in blue, above) are hidden. In general, you can ignore the platform-specific types, and think of <code>int</code> and <code>double</code> as concrete types.</p></div></aside><p>An <code>int</code> on the web is represented as a double-precision floating-point value with no fractional part. In practice, this works pretty well: double-precision floating point provides 53 bits of integer precision. However, <code>int</code> values are always also <code>double</code> values, which can lead to some surprises.</p><div class="header-wrapper"><h2 id="differences-in-behavior">Differences in behavior</h2><a class="heading-link" href="#differences-in-behavior" aria-label="Link to 'Differences in behavior' section">#</a></div><p>Most integer and double arithmetic has essentially the same behavior. There are, however, important differences—particularly when your code has strict expectations about precision, string formatting, or underlying runtime types.</p><p>When arithmetic results differ, as described in this section, the behavior is <strong>platform specific</strong> and <strong>subject to change</strong>.</p><aside class="alert alert-info"><div class="alert-header"><i class="material-symbols" aria-hidden="true">info</i> <span>Note</span></div><div class="alert-content"><p>Any platform-specific behavior that this page describes might change to be less surprising, more consistent, or more performant.</p></div></aside><div class="header-wrapper"><h3 id="precision">Precision</h3><a class="heading-link" href="#precision" aria-label="Link to 'Precision' section">#</a></div><p>The following table demonstrates how some numerical expressions differ due to precision. Here, <code>math</code> represents the <code>dart:math</code> library, and <code>math.pow(2, 53)</code> is 2<sup>53</sup>.</p><p>On the web, integers lose precision past 53 bits. In particular, 2<sup>53</sup> and 2<sup>53</sup>+1 map to the same value due to truncation. On native, these values can still be differentiated because native numbers have 64 bits—63 bits for the value and 1 for the sign.</p><p>The effect of overflow is visible when comparing 2<sup>63</sup>-1 to 2<sup>63</sup>. On native, the latter overflows to -2<sup>63</sup>, as expected for two's-complement arithmetic. On the web, these values do not overflow because they are represented differently; they're approximations due to the loss of precision.</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Expression</th><th>Native</th><th>Web</th></tr><tr><td><code>math.pow(2, 53) - 1</code></td><td><code>9007199254740991</code></td><td><code>9007199254740991</code></td></tr><tr><td><code>math.pow(2, 53)</code></td><td><code>9007199254740992</code></td><td><code>9007199254740992</code></td></tr><tr><td><code>math.pow(2, 53) + 1</code></td><td><code>9007199254740993</code></td><td><code>9007199254740992</code></td></tr><tr><td><code>math.pow(2, 62)</code></td><td><code>4611686018427387904</code></td><td><code>4611686018427388000</code></td></tr><tr><td><code>math.pow(2, 63) - 1</code></td><td><code>9223372036854775807</code></td><td><code>9223372036854776000</code></td></tr><tr><td><code>math.pow(2, 63)</code></td><td><code>-9223372036854775808</code></td><td><code>9223372036854776000</code></td></tr><tr><td><code>math.pow(2, 64)</code></td><td><code>0</code></td><td><code>18446744073709552000</code></td></tr></table></div><div class="header-wrapper"><h3 id="identity">Identity</h3><a class="heading-link" href="#identity" aria-label="Link to 'Identity' section">#</a></div><p>On native platforms, <code>double</code> and <code>int</code> are distinct types: no value can be both a <code>double</code> and an <code>int</code> at the same time. On the web, that isn't true. Because of this difference, identity can differ between platforms, although equality (<code>==</code>) doesn't.</p><p>The following table shows some expressions that use equality and identity. The equality expressions are the same on native and web; the identity expressions are usually different.</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Expression</th><th>Native</th><th>Web</th></tr><tr><td><code>1.0 == 1</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>identical(1.0, 1)</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>0.0 == -0.0</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>identical(0.0, -0.0)</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>double.nan == double.nan</code></td><td><code>false</code></td><td><code>false</code></td></tr><tr><td><code>identical(double.nan, double.nan)</code></td><td><code>true</code></td><td><code>false</code></td></tr><tr><td><code>double.infinity == double.infinity</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>identical(double.infinity, double.infinity)</code></td><td><code>true</code></td><td><code>true</code></td></tr></table></div><div class="header-wrapper"><h3 id="types-and-type-checking">Types and type checking</h3><a class="heading-link" href="#types-and-type-checking" aria-label="Link to 'Types and type checking' section">#</a></div><p>On the web, the underlying <code>int</code> type is like a subtype of <code>double</code>: it's a double-precision value without a fractional part. In fact, a type check on the web of the form <code>x is int</code> returns true if <code>x</code> is a number (<code>double</code>) with a zero-valued fractional part.</p><p>As a result, the following are true on the web:</p><ul><li>All Dart numbers (values of type <code>num</code>) are <code>double</code>.</li><li>A Dart number can be both a <code>double</code> and an <code>int</code> at the same time.</li></ul><p>These facts affect <code>is</code> checks and <code>runtimeType</code> properties. A side effect is that <code>double.infinity</code> is interpreted as an <code>int</code>. Because this is a platform-specific behavior, it might change in the future.</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Expression</th><th>Native</th><th>Web</th></tr><tr><td><code>1 is int</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>1 is double</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>1.0 is int</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>1.0 is double</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>(0.5 + 0.5) is int</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>(0.5 + 0.5) is double</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>3.14 is int</code></td><td><code>false</code></td><td><code>false</code></td></tr><tr><td><code>3.14 is double</code></td><td><code>true</code></td><td><code>true</code></td></tr><tr><td><code>double.infinity is int</code></td><td><code>false</code></td><td><code>true</code></td></tr><tr><td><code>double.nan is int</code></td><td><code>false</code></td><td><code>false</code></td></tr><tr><td><code>1.0.runtimeType</code></td><td><code>double</code></td><td><code>int</code></td></tr><tr><td><code>1.runtimeType</code></td><td><code>int</code></td><td><code>int</code></td></tr><tr><td><code>1.5.runtimeType</code></td><td><code>double</code></td><td><code>double</code></td></tr></table></div><div class="header-wrapper"><h3 id="bitwise-operations">Bitwise operations</h3><a class="heading-link" href="#bitwise-operations" aria-label="Link to 'Bitwise operations' section">#</a></div><p>For performance reasons on the web, bitwise (<code>&</code>, <code>|</code>, <code>^</code>, <code>~</code>) and shift (<code><<</code>,<code>>></code>, <code>>>></code>) operators on <code>int</code> use the native JavaScript equivalents. In JavaScript, the operands are truncated to 32-bit integers that are treated as unsigned. This treatment can lead to surprising results on larger numbers. In particular, if operands are negative or don't fit into 32 bits, they're likely to produce different results between native and web.</p><p>The following table shows how native and web platforms treat bitwise and shift operators when the operands are either negative or close to 32 bits:</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Expression</th><th>Native</th><th>Web</th></tr><tr><td><code>-1 >> 0</code></td><td><code>-1</code></td><td><code>4294967295</code></td></tr><tr><td><code>-1 ^ 2</code></td><td><code>-3</code></td><td><code>4294967293</code></td></tr><tr><td><code>math.pow(2, 32).toInt()</code></td><td><code>4294967296</code></td><td><code>4294967296</code></td></tr><tr><td><code>math.pow(2, 32).toInt() >> 1</code></td><td><code>2147483648</code></td><td><code>0</code></td></tr><tr><td><code>(math.pow(2, 32).toInt()-1) >> 1</code></td><td><code>2147483647</code></td><td><code>2147483647</code></td></tr></table></div><div class="header-wrapper"><h3 id="string-representation">String representation</h3><a class="heading-link" href="#string-representation" aria-label="Link to 'String representation' section">#</a></div><p>On the web, Dart generally defers to JavaScript to convert a number to a string (for example, for a <code>print</code>). The following table demonstrates how converting the expressions in the first column can lead to different results.</p><div class="table-wrapper"><table class="table table-striped nowrap"><tr><th>Expression</th><th>Native <code>toString()</code></th><th>Web <code>toString()</code></th></tr><tr><td><code>1</code></td><td><code>"1"</code></td><td><code>"1"</code></td></tr><tr><td><code>1.0</code></td><td><code>"1.0"</code></td><td><code>"1"</code></td></tr><tr><td><code>(0.5 + 0.5)</code></td><td><code>"1.0"</code></td><td><code>"1"</code></td></tr><tr><td><code>1.5</code></td><td><code>"1.5"</code></td><td><code>"1.5"</code></td></tr><tr><td><code>-0</code></td><td><code>"0"</code></td><td><code>"-0.0"</code></td></tr><tr><td><code>math.pow(2, 0)</code></td><td><code>"1"</code></td><td><code>"1"</code></td></tr><tr><td><code>math.pow(2, 80)</code></td><td><code>"0"</code></td><td><code>"1.2089258196146292e+24"</code></td></tr></table></div><div class="header-wrapper"><h2 id="what-should-you-do">What should you do?</h2><a class="heading-link" href="#what-should-you-do" aria-label="Link to 'What should you do?' section">#</a></div><p>Usually, you don't need to change your numeric code. Dart code has been running on both native and web platforms for years, and number implementation differences are rarely a problem. Common, typical code—such as iterating through a range of small integers and indexing a list—behaves the same.</p><p>If you have tests or assertions that compare string results, write them in a platform-resilient manner. For example, suppose you're testing the value of string expressions that have embedded numbers:</p><div class="code-block-wrapper language-dart"><div class="code-block-body"><span class="code-block-language" title="Language dart">dart</span><pre class="shiki dash-light" tabindex="0"><code><span class="line"><span style="color:#D43324">void</span><span style="color:#6200EE"> main</span><span style="color:#222222">() {</span></span> <span class="line"><span style="color:#D43324"> var</span><span style="color:#222222"> count = </span><span style="color:#11796D">10.0</span><span style="color:#222222"> * </span><span style="color:#11796D">2</span><span style="color:#222222">;</span></span> <span class="line"><span style="color:#D43324"> var</span><span style="color:#222222"> message = </span><span style="color:#11796D">"</span><span style="color:#11796D">$</span><span style="color:#222222">count</span><span style="color:#11796D"> cows"</span><span style="color:#222222">;</span></span> <span class="line"><span style="color:#D43324"> if</span><span style="color:#222222"> (message != </span><span style="color:#11796D">"20.0 cows"</span><span style="color:#222222">) </span><span style="color:#D43324">throw</span><span style="color:#0468D7"> Exception</span><span style="color:#222222">(</span><span style="color:#11796D">"Unexpected: </span><span style="color:#11796D">$</span><span style="color:#222222">message</span><span style="color:#11796D">"</span><span style="color:#222222">);</span></span> <span class="line"><span style="color:#222222">}</span></span></code></pre></div></div><p>The preceding code succeeds on native platforms but throws on the web because <code>message</code> is <code>"20 cows"</code> (no decimal) on the web. As an alternative, you might write the condition as follows, so it passes on both native and web platforms:</p><div class="code-block-wrapper language-dart"><div class="code-block-body"><span class="code-block-language" title="Language dart">dart</span><pre class="shiki dash-light" tabindex="0"><code><span class="line"><span style="color:#D43324">if</span><span style="color:#222222"> (message != </span><span style="color:#11796D">"</span><span style="color:#11796D">${20.0}</span><span style="color:#11796D"> cows"</span><span style="color:#222222">) </span><span style="color:#D43324">throw</span><span style="color:#222222"> ...</span></span></code></pre></div></div><p>For bit manipulation, consider explicitly operating on 32-bit chunks, which are consistent on all platforms. To force a signed interpretation of a 32-bit chunk, use <code>int.toSigned(32)</code>.</p><p>For other cases where precision matters, consider other numeric types. The <a href="https://api.dart.dev/dart-core/BigInt-class.html"><code>BigInt</code></a> type provides arbitrary-precision integers on both native and web. The <a href="https://pub.dev/packages/fixnum"><code>fixnum</code></a> package provides strict 64-bit signed numbers, even on the web. Use these types with care, though: they often result in significantly bigger and slower code.</p><p id="page-github-links"><span>Unless stated otherwise, the documentation on this site reflects Dart 3.5.4. Page last updated on 2024-11-17.</span> <a href="https://github.com/dart-lang/site-www/tree/main/src/content/guides/language/numbers.md" target="_blank" rel="noopener">View source</a> <span>or </span><a href="https://github.com/dart-lang/site-www/issues/new?template=1_page_issue.yml&page-url=https://dart.dev/guides/language/numbers/&page-source=https://github.com/dart-lang/site-www/tree/main/src/content/guides/language/numbers.md" title="Report an issue with this page" target="_blank" rel="noopener">report an issue</a>.</p></div></article></main><footer id="page-footer"><div class="footer-section footer-main"><a href="/" class="brand" title="Dart"><img src="/assets/img/logo/logo-white-text.svg" alt="Dart" width="164"></a><div class="footer-social-links"><a href="https://medium.com/dartlang" target="_blank" rel="noopener" title="Medium blog"><svg><use href="/assets/img/social/medium.svg#medium"></use></svg> </a><a href="https://github.com/dart-lang" target="_blank" rel="noopener" title="GitHub"><svg><use href="/assets/img/social/github.svg#github"></use></svg> </a><a href="https://twitter.com/dart_lang" target="_blank" rel="noopener" title="X (Twitter)"><svg><use href="/assets/img/social/x.svg#x"></use></svg></a></div></div><div class="footer-section footer-tray"><div class="footer-licenses">Except as otherwise noted, this site is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>, and code samples are licensed under the <a href="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</a>.</div><div class="footer-utility-links"><ul><li><a href="/terms" title="Terms of use">Terms</a></li><li><a href="https://policies.google.com/privacy" target="_blank" rel="noopener" title="Privacy policy">Privacy</a></li><li><a href="/security" title="Security philosophy and practices">Security</a></li></ul></div></div></footer></body></html>