Geeta Kathpalia wrote at Fri, 27 Sep 2002 13:57:29 +0200:

>         I am executing the following perl code(using 5.8.0):
>  
>                 $a = -9223372036854775808;
>                 $a--;
>                 if ($a ==  -9223372036854775807)
>                 {
>                         print "ok \n";
>                 }
>         
>          The output which i get is that:     ok get printed.
>  
> How is it possible??

Changing your script a bit to
 
$a = -9223372036854775808;
                $a--;
                if ($a ==  -9223372036854775807)
                {
                        print "ok ($a)\n";
                }


explains what happens,
as now is printed
ok (-9.22337203685478e+18)

Obviously, Perl converts the number automatic to a float,
where the one more or less isn't important any longer.


Greetings,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to