Skip to content

Домашнее задание 12.2. Double под микроскопом. Разгуляева А.И. #11

Open
ada1ra wants to merge 6 commits intomainfrom
hw_12-2_double
Open

Домашнее задание 12.2. Double под микроскопом. Разгуляева А.И. #11
ada1ra wants to merge 6 commits intomainfrom
hw_12-2_double

Conversation

@ada1ra
Copy link
Owner

@ada1ra ada1ra commented Dec 1, 2025

No description provided.

@ada1ra ada1ra requested a review from chernishev December 1, 2025 15:43
Copy link
Collaborator

@p-senichenkov p-senichenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет тестов, CMake и CI.

char decimal_digits[21]; // массив для хранения 20 цифр + 1 для округления
int digit_count = 0;

// генерируем 21 цифру (20 для вывода + 1 для округления)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему именно 20 цифр? IEEE754 double хранит 53 значащих бита. Именно столько и нужно сохранять.

} DoubleConverter;

// преобразование double в экспоненциальный формат (sm*2^p)
char* doubleExponential(double number)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выделите отдельные функции. Не должна одна функция занимать полтора экрана.

Comment on lines +89 to +100
// удаляем незначащие нули с конца
while (digit_count > 0 && decimal_digits[digit_count - 1] == '0') {
digit_count--;
}

// выводим дробную часть, если есть значащие цифры
if (digit_count > 0) {
result[pos++] = '.';
for (int i = 0; i < digit_count; i++) {
result[pos++] = decimal_digits[i];
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь уже совсем что-то не то делается.

ada1ra and others added 4 commits December 10, 2025 12:29
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants