Summing up read values

Hello! I am trying to add the values read from a voltage divider, but instead my code gives me the same value for sum as for vin. Basically I want it to sum me up the vin value at every loop. I am a newbie, so how can I make that?

Here's my code:

float sum = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
int sensorValue = analogRead(A1);

float vout = (sensorValue * 5.0) / 1024.0;
float vin= vout / (75.0/(75.0+300.0));
sum =+ vin;

Serial.print(vout);
Serial.print(", ");
Serial.print(vin);
Serial.print(", ");
Serial.println(sum);
delay(1000);
}

 sum =+ vin;

This says that sum equals the value of plus vin.

   sum += vin;

uses a different operator...

Thanks a lot!

As a matter of trivia, the -= and += operators used to be spelled =- and =+ in some of the oldest versions of C (back in the early 1970s). They were changed to the modern spellings because of (I believe) ambiguity in statements like x=-1. I.e., does that statement subtract one from x or set x to negative one?

I'm not at my machine, but does anyone know if the compiler takes this statement:

 float vin= vout / (75.0/(75.0+300.0));

and automatically simplifies it to:

 float vin= vout / (.2);

My guess is that it does.

My guess is that it does

That would be correct.