Skip to content

Домашнее задание 12.1. Двоичное представление. Разгуляева А.И.#12

Open
ada1ra wants to merge 8 commits intomainfrom
hw_12-1_binary
Open

Домашнее задание 12.1. Двоичное представление. Разгуляева А.И.#12
ada1ra wants to merge 8 commits intomainfrom
hw_12-1_binary

Conversation

@ada1ra
Copy link
Owner

@ada1ra ada1ra commented Dec 1, 2025

No description provided.

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

#include <stdlib.h>
#include <string.h>

// функция для определения необходимого количества бит (двоичное представление зависит от количества бит)
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 7 commits December 10, 2025 12:26
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>
Comment on lines +73 to +75
}
// если число отрицательное (старший бит = 1, дополнительный код)
else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

По стайлгайду else форматируется не так

Comment on lines +99 to +100
// определяем необходимое количество бит
int bits = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Очень странный комментарий. И bits лучше сделать символьной константой.


// заполняем строку нулями
for (int i = 0; i < bits; i++) {
binary[i] = '0';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Удобнее было бы работать с bool, или хотя бы 0 и 1, а не символами

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