Skip to content

Comments

Double под микроскопом#11

Open
shannami wants to merge 6 commits intomainfrom
DoubleMicroscope
Open

Double под микроскопом#11
shannami wants to merge 6 commits intomainfrom
DoubleMicroscope

Conversation

@shannami
Copy link
Owner

@shannami shannami commented Dec 1, 2025

Шалахина Анна дз-12

@shannami shannami requested a review from WoWaster December 1, 2025 20:53
Copy link
Collaborator

@WoWaster WoWaster left a comment

Choose a reason for hiding this comment

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

Честно говоря, выглядит так, будто Вы это в попыхах то ли списали, то ли нагенерили.

double getMantissa(Number num);


int getBit(Number num, int i);
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 +31 to +36
TestNumber(-2.0, "-1*2^1");
TestNumber(2.0, "+1*2^1");
TestNumber(1.0, "+1*2^0");
TestNumber(-1.0, "-1*2^0");
TestNumber(0.5, "+1*2^-1");
TestNumber(-0.5, "-1*2^-1");
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 +7 to +11
bool DoubleEquals(double a, double b, double eps) {
return fabs(a - b) < eps;
}

bool TestNumber(double value, const char* expected) {
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 +9 to +11
int getSign(Number num);
int getExponent(Number num);
double getMantissa(Number num);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Комментарии?

#include "DoubleMicroscope.h"


int getBit(Number num, int i) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Код надо отформатировать.

#include "DoubleMicroscope.h"

int main() {
Number num;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Инициализация.

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