I've been re-writing a BASIC program to PHP. I've run across a problem, let me explain:
In the BASIC code I have the following statement with values:
LSLATVER=1590
PITCHVER=50
NRSLATHOR=INT(LSLATVER/PITCHVER-.8)
// output: 30
In PHP the code I have two examples like this:
$length_vertical_slat = 1590;
$vertical_pitch = 50;
echo $number_of_horizontal_slats = (int) ($length_vertical_slat / $vertical_pitch - .8);
// output: 31
echo $number_of_horizontal_slats = (int) ($length_vertical_slat / ($vertical_pitch - .8));
// output: 32
Why is there such a huge difference between the 3 examples? I need the PHP to output a value of 30 in this example but I do not see how to go about it. Please help ty!