Anonymous user
Roots of a function: Difference between revisions
→{{header|Dart}}
Line 702:
=={{header|Dart}}==
{{trans|Scala}}
<lang Dart>double fn(double x) => x * x * x - 3 * x * x + 2 * x;▼
▲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) {
|