Roots of a function: Difference between revisions

Line 702:
=={{header|Dart}}==
{{trans|Scala}}
<lang Dart>double fn(double x) => x * x * x - 3 * x * x + 2 * x;
<lang Dart>
double fn(double x) => x * x * x - 3 * x * x + 2 * x;
 
double findRoots(Function(double) f, double start, double stop, double step, double epsilon) {
for (double x = start; x < stop; x = x + step) {