Programming with Laser Range finder

Hello,

I'm programming a Hokuyo laser range finder in C++. When the range finder is not plugged in the following code works fine, but when I plug in the range finder the code assigns startIndex the largest possible int value.Not sure exactly what is happening. any help would very appreciated. Thanks in advance.

degree = .3390957447;
int startIndex = 0, endIndex = 0;
if(lowR <= 0)
startIndex = abs(lowR/degree);

What's the value of lowR at those times? What's the type of degree?
lowR is equal to -45 and degree a double.
Topic archived. No new replies allowed.