Skip Menu |

This queue is for tickets about the Math-BigInt CPAN distribution.

Report information
The Basics
Id: 19276
Status: resolved
Worked: 10 min
Priority: 0/
Queue: Math-BigInt

Owner: TELS [...]
Requestors: eastonbeymer [...]

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)

Subject: bignum error...
Date: Mon, 15 May 2006 12:13:48 -0700
To: <bug-Math-BigInt [...]>
From: "Easton Beymer" <eastonbeymer [...]>
Download (untitled) / with headers
text/plain 3.1k
Hi again, Tels, I have moved this message to a to a pop3, smtp mail server... Thanks for putting in the request to delete the message with the attachments. I figured I was really pushing the limits of tieing and overloading, but cobol and big bcd integer processing (including scaling) with the absence of floating point rounding errors is basic to cobol -- cobol requires accuracy to the penny. This package is really aimed at Perl 6 and Parrot (is there ever really going to be such a thing in my lifetime???). In order to emulate the data structures and data types inherent in cobol, it was necessary to use tied variables. I am not particularly concerned about performance with the bignum package -- it is more important to me to be able to accurately mirror the accuracy spelled out the the cobol standard. I will make the change to "Cobol" for the package name. I am wanting to implement rounding on an arithmetic statement by statement basis, but am lost as to how to implement this in bignum. Good examples seem to be lacking. Again, thanks... Easton -------------------------------------------------------------------------------- Show quoted text
> Subject: Re: [ #19253] Error in bignum, BigInt... > From: > To: > Date: Mon, 15 May 2006 14:14:00 -0400 > > > <URL: > > > Moin, > > On Monday 15 May 2006 19:18, via RT wrote:
> > Queue: Math-BigInt > > Ticket <URL: > > > > > Hi Tels, > > > > I tried coming up with a stripped down version, but the error goes away > > once I start stripping... > > > > Attached are the full programs causing the problem. > > > > is the code for a runtime package for a cobol compiler written > > in Perl, and I consider it to be proprietary at this time.
> > Unfortunately, you just posted it to, a public website :) > > I will try to see what's causing the problem, but it is very likely tie > plus the overload from bignum/bigint. Both bigint/bignum and bigrat are a > cheat/trick to trick Perl into working with long numbers. It works for > simple cases, but breaks down for more complicated stuff due to hairy > edge cases - a bigint is an overloaded object and a lot of code does not > expect to get something else than a scalar. > > So in many cases it is better to use Math::BigInt (or BigFloat) > explicitely and use only long math when really nec. This also makes > things much faster, generally :) > > Some comments: > > * Please use an uppercase first letter for packages so "use Cobol;" and > not "use cobol;" unless you really want to write a pragma (which is some > sort of special package reserved for internal stuff enhancing Perl :) > * I don't have Win32/ - I took out the references to it and the > error occurs, so I guess it doesn't matter for this bug. > > Thanx for your report, > > Tels > > -- > Signed on Mon May 15 20:07:25 2006 with key 0x93B84C15. > Visit my photo gallery at > PGP key on or per email. > > "Remember: If the game let's you do it, it's not cheating." -- Xarax > >
Download (untitled) / with headers
text/plain 530b
I am not sure what exactly you are trying to acomplish, so a bit Perl code with "expected here XYZ" lines would be good. Have you looked at the global rounding parameters: use Math::BigFloat; Math::BigFloat->accuracy(5); my $x = Math::BigFloat->new("1.2345678"); print "$x\n"; $x += '0.12345678'; print "$x\n"; Another method would be to create a subclass of Math::BigFloat and overload all the math operators. There is an example in the testsuite under t/Math/BigFloat/ for a minimal code. Best wishes, Tels
Download (untitled) / with headers
text/plain 175b
Marking this as resolved since I can't figure out what the actual problem is, or what I should do. If you still have problems, please reply to this message to reopen the bug.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to