fix modf error

This commit is contained in:
hugogogo
2026-05-10 01:51:35 +02:00
parent ca99f43fe4
commit 5077db3bc6
5 changed files with 42 additions and 20 deletions

View File

@@ -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
## NewtonRaphson 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