- or download this
#!/usr/local/bin/perl -w
...
print "Number 2 : $expected \n";
print "Not" if ( $expected != $premium );
print "Equal !! ";
- or download this
Number 1 : 1.98
Number 2 : 1.98
NotEqual !!
- or download this
;# Sub : isEqualFloat
;# Desc : to compare two floating point numbers and find out if
...
return ( abs ( $float1 - $float2 ) < $delta )
}
- or download this
if ( isEqualFloat(1.98, ( 1.8 * (1 + 10/100) )) ) {
# do something
...
...
}