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.