Got a bit of a head scratcher. I'm loading values fro a CSV, casting them to be a float, doing some simple arithmetic then comparing the result with a 4th value and logging an error if the results do not match.
$CsvArrayLine[2] = (float) $CsvArrayLine[2];
$CsvArrayLine[3] = (float) $CsvArrayLine[3];
$CsvArrayLine[4] = (float) $CsvArrayLine[4];
$GwTempTotal = $CsvArrayLine[2] + $CsvArrayLine[3];
$GwTempTotal = $GwTempTotal * $CsvArrayLine[4];
$GwTempGiven = (float) $CsvArrayLine[5];
if ($GwTempTotal != $GwTempGiven){
var_dump($GwTempTotal);
echo "</br>";
var_dump($GwTempGiven);
echo "</br>";
$GwErrorArray[] = array("03","$CsvArrayLine[0]"," $GwTempTotal each cost + pack each cost x pack does not = gross, this is BAD</br>");
}
Which is all good and for 24 lines of the 29 I'm testing it works fine. 5 of the lines however give an error even though the values are identical. The output from the var_dumps is that they are all floats and that they are all the same.
Is there anything obvious I'm missing that someone can see?