I'm new to both stackoverflow and C++ so please bear with me.
I'm trying to write a program that takes 3 numbers from the user, runs them through the quadratic formula, and returns: the discriminant, the line of symmetry, the number of solutions (Based on whether the discriminant is positive or negative), and the solutions themselves. Almost all of the program works as expected, except for the positive solution. This doesn't return any kind of error, just the wrong value. The function for the negative solution is exactly the same (Except for the subtraction) and returns the correct value.
The problematic code:

```
float solA(float numNegB, float discrim, float numC) {
float solution1;
solution1 = (numNegB + sqrt (discrim))/(2*numC);
return solution1;
}
```

The working code:

```
float solB(float numNegB, float discrim, float numC) {
float solution2;
solution2 = (numNegB - sqrt (discrim))/(2*numC);
return solution2;
}
```

The whole program:

```
#include <iostream>
#include<math.h>
using namespace std;
//Declare function for taking the negative of b
float negB(float B);
//Declare function for calculating line of symmetry
float LoS(float A, float B);
//Declare function for calculating Discriminant
float disCrim(float A, float B, float C);
//Declare function for determing # of numberSolutions
int numSol(float D);
//Declare function for calculating solution A
float solA(float negativeB, float discrim, float A);
//Declare function for calculating solution B
float solB(float negativeB, float discrim, float A);
int main()
{
//Declare variables
float a, //a
b, //b
c, //c
nB, //negative of b
loS, //Line of Symmetry
discriminant, //discriminant b^2-4ac
sol1, //1st solution +
sol2; //2nd solution -
int noS;
//Get values for a, b, c from user
cout << "Enter value for a: \n";
cin >> a;
cout << "Enter value for b: \n";
cin >> b;
cout << "Enter value for c: \n";
cin >> c;
//Call negB to get negative value of b
nB = negB(b);
cout << "The negative of b is " << nB << endl;
//Call LoS to get the line of symmetry
loS = LoS(a, b);
cout << "The line of symmetry is " << loS << endl << endl;
//Call disCrim to get the discriminant
discriminant = disCrim(a, b, c);
cout << "The discriminant is " << discriminant << endl << endl;
//Call numSol to get the number of solutions
noS = numSol(discriminant);
cout << "There are " << noS << " solutions to this equation." << endl;
//Call solA to get solution A for the equation
sol1 = solA(nB, discriminant, c);
cout << "The first solution is: " << sol1 << endl << endl;
//Call solB to get solution B for the equation
sol2 = solB(nB, discriminant, c);
cout << "The second solution is: " << sol2 << endl << endl;
return 0;
}
//negB multiplies b by -1
float negB(float numB) {
numB = numB * -1;
return numB;
}
//LoS multiplies b by -1, then divides result by 2a
float LoS(float numA, float numB) {
float sym;
sym = (numB * -1)/(2 * numA);
return sym;
}
//disCrim calculates the discriminant
float disCrim(float numA, float numB, float numC) {
float D;
D = (numB * numB) - (4 * numA * numC);
return D;
}
//numSol calculates the number of solutions
int numSol(float numD) {
int nS;
if (numD < 0)
nS = 0;
else if (numD == 0)
nS = 1;
else
nS = 2;
return nS;
}
//solA calculates the positive solution
float solA(float numNegB, float discrim, float numC) {
float solution1;
solution1 = (numNegB + sqrt (discrim))/(2*numC);
return solution1;
}
//solB calculates the negative solution
float solB(float numNegB, float discrim, float numC) {
float solution2;
solution2 = (numNegB - sqrt (discrim))/(2*numC);
return solution2;
}
```

Any assistance is appreciated!