On Sun, 19 Jun 2011, Uri Guttman wrote:
"PD" == Patrick Dupre <patrick.du...@york.ac.uk> writes:
PD> There is not option like (double) $res ?
rtfm to the rescue!
the synopsis shows how to do it. since it is a pragma it affects all
calculations in the scope. disabling the pragma is how you can get it
back to a regular float:
use bignum;
$x = 2 + 4.5,"\n"; # BigFloat 6.5
print 2 ** 512 * 0.1,"\n"; # really is what you think it is
print inf * inf,"\n"; # prints inf
print NaN * 3,"\n"; # prints NaN
{
no bignum;
print 2 ** 256,"\n"; # a normal Perl scalar now
}
This is what I tried first, the point is when you quite the
enclosure, even if you use no bignum, since the variables have declared
previous as bignumn any calculation using such variables previous
declared as bignum will be store in variables of the same type.
This make sense for perl, only a cast should allow changing the size.
In addition, the physical size (SV) of a bignum seems a lot bigger
than a usual NV.
Thank.
--
---
==========================================================================
Patrick DUPRÉ | |
Department of Chemistry | | Phone: (44)-(0)-1904-434384
The University of York | | Fax: (44)-(0)-1904-432516
Heslington | |
York YO10 5DD United Kingdom | | email: patrick.du...@york.ac.uk
==========================================================================
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/