/
Vladcore
/
Koren
Обзор
Документация
Войти
/
Vladcore
/
Koren
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
operation
15 строк
356 B
Vladcore
create operation
15 сен 2024, 01:41
15 сен 2024, 01:41
e617614
Код
Авторство
О чём код?
#include "operation.h" #include <math.h> void solveQuadraticEquation(double a, double b, double c, double& x1, double& x2) { double discriminant = b * b - 4 * a * c; if (discriminant < 0) { x1 = x2 = NAN; return; } x1 = (-b + sqrt(discriminant)) / (2 * a); x2 = (-b - sqrt(discriminant)) / (2 * a); }