From: "Chas. Owens" <chas.ow...@gmail.com>
What would be the problem if the way of doing calculations by using bignum
would be the default?
Does it give errors? It would be helpful to know.

Octavian

Because it is slower.

Well, PHP does it faster than Perl, even if it also hide the inaccuracy.

If you want to use bignums by default you can use the
[bignum][0] pragma, but be warned, there is a massive performance penalty:

You are right, and that's why I try to make a module that just uses sprintf() or that just first multiplies the numbers with say.. a million, do the operation and then divide by a million, but I need to make that module work like bignum, without needing to define objects in my application, but just do:

use MyModule;
print 0.079 - 0.085;

This should be clean enough but I couldn't find yet how I can overload some operators with float numbers.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to