Task 8 is done
This commit is contained in:
parent
2efd819d0f
commit
98a608ce96
22 changed files with 1270 additions and 0 deletions
30
2025.04.18/08Ex/solve.c
Normal file
30
2025.04.18/08Ex/solve.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include "solve.h"
|
||||
#include "contin_func.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
double dln (double x, const double eps)
|
||||
{
|
||||
double value = 0;
|
||||
int b = 0;
|
||||
|
||||
while (x - 2 > DBL_EPSILON)
|
||||
{
|
||||
x *= 0.5;
|
||||
b++;
|
||||
}
|
||||
|
||||
while (x - 1 <= DBL_EPSILON)
|
||||
{
|
||||
x *= 2;
|
||||
b--;
|
||||
}
|
||||
|
||||
value = fln(x, eps);
|
||||
|
||||
value += b * M_LN2;
|
||||
return value;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue