Skip to content

Conversation

Lo-Lap
Copy link
Owner

@Lo-Lap Lo-Lap commented Oct 8, 2023

No description provided.

set(PROJECT_HEADERS Calculator_main.h, calcul.h)
add_executable(Calculator_main ${PROJECT_SOURCE_DIR}/ Calculator_main.cpp calcul.cpp "dll_read.cpp" "dll_read.h")

add_library(cos SHARED ./plugins/cos.cpp "plugins/cos.cpp" "dll_read.cpp" "dll_read.h")

Choose a reason for hiding this comment

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

Не должно быть прямых упоминаний библиотек в файлах сборки

if ((number.size() != 0) || (operation.size() != 0)) std::cin.ignore();//extracting the viewed symbol from the stream
continue;
}
if ((c == 'c') || (c == 'l') || (c == 's') || (c == 't') || (c == 'r') || (c == 'a'))

Choose a reason for hiding this comment

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

Что это?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Здесь производится проверка словили ли первый символ от нестандартной функции (sin, cos, ctg, tg и т.д.)
Потом считывается всё что до открывающейся скобки и записывается в map с операциями. Потом при обработке этих функций, если окажется что было считано, что-то не то (например, cas), то выведется исключение, что некорректно введено выражение.

Choose a reason for hiding this comment

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

Зачем привязываться к первым буквам? Почему нельзя добавить синус через Sin(), как в таком случае добавить факториал, floor, fract... ?

}
}
continue;
}

Choose a reason for hiding this comment

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

Очень длинная функция

return;
}

bool calcul::check_neg(std::string c)//processing negative numbers if it is the first number in the expression or comes after the opening parenthesis

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