8 lines
162 B
C++
8 lines
162 B
C++
float racine_carree(float a, unsigned int n) {
|
|
float root = 1;
|
|
|
|
for (int i=0; i < n; i++) {
|
|
root = (root + a / root) / 2;
|
|
}
|
|
return root;
|
|
} |