Hi,
Just wondering why ActiveState's 64-bit build of perl has 
"use64bitint=define" but "uselongdouble=undef".

I have no doubt that there are good reasons - just wondering what they are 
:-)

Whilst I have come across a number of builds of perl (linux, cygwin) that 
were built with "use64bitint=define", I have not yet encountered a build 
that supports long doubles.

The following script hints at my interest in seeing "uselongdouble=define".

-----------------------------------------
use warnings;

$v = 2 ** 57 + 12345; # 144115188075868217

{
use integer;
$w = 2 ** 57 + 12345;
}

if($w - 10 == $v - 10) {print "Correct\n"}
else {print "Wrong\n"}

$y = '144115188075868217';
$z = '144115188075868217rubbish';

{
no warnings 'numeric';
if($y == $z) {print "Correct\n"}
else {print "Wrong\n"}
}
-----------------------------------------

On my 64-bit build of ActivePerl 820, that script outputs:

Wrong
Wrong

I believe that, if perl were also built with "uselongdouble=define" then the 
same script would output:

Correct
Correct

And, for me, the latter DWIMs better than the former.

I have a second (tenuously related) question. When I first wrote the above 
test script I had:

if($w == $v) {print "Correct\n"}
else {print "Wrong\n"}

And that produced "Correct". Yet a Devel::Peek::Dump() reveals that $v is an 
NV which, owing to loss of precision, could surely only contain the value 
144115188075868224. Otoh, $w is an IV with the value 144115188075868217. I'm 
still trying to work out how perl arrives at the conclusion that $w == $v.

(I then rewrote the code as '$w - 10 == $v - 10' simply because that 
demonstrated the anomaly I was wanting to demonstrate.)

Cheers,
Rob

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

Reply via email to