fix modf error
This commit is contained in:
10
README.md
10
README.md
@@ -89,11 +89,15 @@ finding the square root of x
|
||||
|
||||
## dichotomy method
|
||||
|
||||
the dichotomie method, or binary search, consist on dividing the range of research by 2 each time, and choosing the right one for the next iteration.
|
||||
|
||||
Ex :
|
||||
|
||||
```
|
||||
solution
|
||||
↓
|
||||
|------------------------------ 1. define range bound_1 : 0
|
||||
|-----------------------------| 2. choose range bound_2 : x
|
||||
|-----------------------------| 2. define range bound_2 : x
|
||||
|--------------+--------------| 3. take mid : (bound_1 + bound_2) / 2
|
||||
|--------------|-------ø------| 4. choose range bound : bound_1 or bound_2
|
||||
|
||||
@@ -123,7 +127,9 @@ finding the square root of x
|
||||
|
||||
## Newton–Raphson method
|
||||
|
||||
it's like a self-correcting binary search, we get rid of the step "choose range" :
|
||||
it's like a self-correcting binary search, we get rid of the step "choose range", we use the formulae `x/v` to find the next range, with `x` being the number we are trying to get the sqaure root from, and `v` the value found at the previous step.
|
||||
|
||||
Ex :
|
||||
|
||||
```
|
||||
solution
|
||||
|
||||
Reference in New Issue
Block a user