HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to DartVariablesData TypesOperatorsStringsListsConditions (if / else)Loops (for / while)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Variables & Types
🔢 Numbers & Math
Math operators.abs() / .round()sqrt() / pow() (dart:math)
✍️ String
📚 List & Map
🔀 Condition & Loop
🧩 Function
Dart›REFERENCE›Numbers & Math›sqrt() / pow() (dart:math)

sqrt() / pow() (dart:math)

Square root and powers (math library).

Syntax

import 'dart:math';  sqrt(x)  pow(x, y)

Description

Square root (sqrt), power (pow), pi, and random numbers are inside dart:math. You must write import 'dart:math'; before using them.

Example

Loading editor…

Expected output

9.0
1024

When to use?

Geometry, statistics, exponential calculations.

Common mistakes

  • ⚠️ Forgetting to write import 'dart:math'; causes an error.

Related commands

Math operators
← .abs() / .round()
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code