cannot display a negative number

Hi,
My code sample some voltage data from a sensor via Pin A0. But It only displays zero insteat of a negative number when the voltage is negative.
why?
my code is as the following:

int led =13;
void setup(){
  //initialize serial communication at 4800bit per second;
Serial.begin(4800);
pinMode (led,OUTPUT);
}


void loop(){
//read the input on analog pin A0;
int voltageValue = analogRead(A0);
float voltage = voltageValue * (5.0 / 1023.0);

if (voltage>=0.5||voltage<=-0.5){
  digitalWrite(led,HIGH);
}
else{
digitalWrite(led,LOW);
}
// Serial.println("voltage = ");
Serial.println(voltage);
}

the command "print" can not return a negative number?

the command "print" can not return a negative number?

Yes it can. The Arduino can't deal with a negative voltage. OP, you'll ruin your Arduino if you don't learn what it is, and is not, capable of.

Hi Pauls,
if I measure a negative voltage, I just want to display the voltage value. what can I do?

if I measure a negative voltage, I just want to display the voltage value. what can I do?

Use something besides an Arduino. An Arduino can measure voltages in the range 0 to 5V.

if I measure a negative voltage

The you have screwed your arduino. They take damage if you feed negative values into them.