Directory: | ./ |
---|---|
File: | s21_help.c |
Date: | 2025-08-15 23:01:21 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 10 | 10 | 100.0% |
Branches: | 14 | 14 | 100.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | #include "s21_help.h" | ||
2 | |||
3 | 410 | int s21_check_matrix_is_invalid(matrix_t *A) { | |
4 |
8/8✓ Branch 0 taken 384 times.
✓ Branch 1 taken 26 times.
✓ Branch 2 taken 382 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 380 times.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 378 times.
|
410 | int check = A == NULL || A->rows <= 0 || A->columns <= 0 || A->matrix == NULL; |
5 | |||
6 |
2/2✓ Branch 0 taken 378 times.
✓ Branch 1 taken 32 times.
|
410 | if (!check) { |
7 |
4/4✓ Branch 0 taken 940 times.
✓ Branch 1 taken 376 times.
✓ Branch 2 taken 938 times.
✓ Branch 3 taken 2 times.
|
1316 | for (int i = 0; i < A->rows && !check; i++) { |
8 | 938 | check = A->matrix[i] == NULL; | |
9 | } | ||
10 | } | ||
11 | |||
12 | 410 | return check; | |
13 | } | ||
14 | |||
15 | 256 | int s21_are_doubles_equal(double a, double b) { | |
16 | 256 | double round_a = round(a * 1000000.0); | |
17 | 256 | double round_b = round(b * 1000000.0); | |
18 | |||
19 | 256 | return fabs(round_a - round_b) < 1.0; | |
20 | } | ||
21 |