[ create a new paste ] login | about

Link: http://codepad.org/kaVXM5g0    [ raw code | output | fork ]

PHP, pasted on Aug 27:
<?php
$tl_pax = 1;
$ct_pax = 2;
$at_pax = 2;

$a = 0.5;
$b = 0.2;
$c = 0.2;
$d = 0.2;
$e = 0.2;
$f = 0.2;
$g = 0.2;
$h = 0.9;

$sum = $a + $b + $c + $d + ($e * $tl_pax) + ($f * $ct_pax) + ($g * $at_pax) + $h;

$total = 3;

if($total-0.0000001 <= $sum && $sum <= $total+0.0000001){
    echo 'equal: ' . $sum . ' - ' . $total;
}
else{
    echo 'not equal: ' . $sum . ' - ' . $total;
}


Output:
1
equal: 3 - 3


Create a new paste based on this one


Comments: