Lukas Ruf said:
Abigail [10 Jul 2006 22:26:45 GMT]:
thanks for answering,
Lukas Ruf (
[email protected]) wrote on MMMMDCXCVI September MCMXCIII in
<URL:news:
[email protected]>:
A Perl using 32-bit integers will automatically convert integers to
floats. If you're dealing with numbers up to about 2**53, there shouldn't
be any loss of precision.
weird, why do I still get '-1' even when using 'bignum'?
Checkout 'perldoc -f sprintf' (which applies equally to the 'printf'
function). There you'll find:
%d a signed integer, in decimal
Specifying "%d" is good for numbers up to 31 bits (plus the 'sign' bit) only
on 32-bit systems (since that's the size of a signed integer). For larger
numbers up to 2 ** 53 use "%f" (or "%.0f" if you want to avoid the decimal
point) .... or you may find that simply using the 'print' function instead
of the 'printf' function produces the output you want.