Just the same, ought to do it....

$x = 50.50;
$y = 36.45;

if ($x > $y) { print "$x is greater than $y\n" }
else         { print "$x is less than or equal to $y\n" }

prints out "50.5 is greater than 36.45" on my machine...

HTH,

Deane


"Krishna, Hari" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

11/19/2004 12:42

       
        To:        [EMAIL PROTECTED]
        cc:        
        Subject:        comparing floting point numbers



I am trying to compare floating numbers and it doesn't seem to work..
 
I thought its just the same comparison as we normally do for numbers.
 
like..
 
$x=5;
$y=6
 
if($x>$y)....
 
how do I do for
 
$x=50.50;
$y=36.45;
 
if($x>$y)....
 
Thanks,
Hari

CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. You may NOT use, disclose, copy or disseminate this information. If you are not the intended recipient, please contact the sender by reply e-mail immediately. Please destroy all copies of the original message and all attachments. Your cooperation is greatly appreciated. Columbus Regional Hospital 2400 East 17th Street Columbus, Indiana 47201
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to