-
Notifications
You must be signed in to change notification settings - Fork 0
Lowercase calculator with different operations #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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") |
There was a problem hiding this comment.
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')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что это?
There was a problem hiding this comment.
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), то выведется исключение, что некорректно введено выражение.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем привязываться к первым буквам? Почему нельзя добавить синус через Sin(), как в таком случае добавить факториал, floor, fract... ?
} | ||
} | ||
continue; | ||
} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему символ передается как контейнер?
No description provided.