Thanks for the reply Janek.

        If the number is converted to float, then as the result shows, the
number is truncated a bit,
        from -9223372036854775808 to -9.22337203685478e+18.
        If yes, then how come 
                 printf "ok %f", $a;
        still gives the correct number(without truncation).
        The output is : ok -9223372036854775808.000000

Thanks & Regards
Geeta

-----Original Message-----
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 4:52 PM
To: [EMAIL PROTECTED]
Subject: Re: Regarding decrementing IV_MIN(Integer minimum)


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]

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

Reply via email to