Flowchart (ISO 5807)
Source code
C++
double f(double x) {
return x * x - 2;
}
double bisection(double a, double b, double eps) {
double m;
while (b - a > eps) {
m = (a + b) / 2;
if (f(a) * f(m) < 0) {
b = m;
} else {
a = m;
}
}
return (a + b) / 2;
}The editor opens with this code — change it and the chart redraws.
- Language
- C++
- Constructs
- numeric method, while
- Topic
- Algorithms
- Formats
- Word, Visio, draw.io, PDF, SVG