Skip Menu |
 

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

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

People
Owner: TELS [...] cpan.org
Requestors: mike.bidwell [...] jeppesen.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.77
Fixed in: (no value)



Subject: Can't call method Math::BigFloat->bsub, not a valid method
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1847
Download (untitled) / with headers
text/plain 1.8k
In the class Math::BigFloat when you have fsub called out in your program and it goes to Math::BigFloat to do the calculation it is suppossed to alias back to bsub. It corectly aliases but the $class variable is not correctly set to Math::BigInt where bsub sub-routine is declared at, it is trying to find the bsub routine in the Math::BigFloat module instead and since it is not there it fails out. Heres my code snippet: $sdate = new Math::BigFloat "365.25"; $mdate = new Math::BigFloat "30.6001"; $a = int($year/100); $b = int($a/4); $c = int((2 - $a)+$b); $e = int($sdate*($year + 4716)); $f = int($mdate*($mon + 1)); $cdate = ((($c+$day)+$e)+$f); $cdateStr = new Math::BigFloat( $cdate ); $cdateStr->fsub(1524); $cdateStr->fabs($cdateStr); And here is the code snippet out of Math::BigFloat: my $name = $AUTOLOAD; $name =~ s/(.*):://; # split package my $c = $1 || $class; no strict 'refs'; $c->import() if $IMPORT == 0; if (!method_alias($name)) { if (!defined $name) { # delayed load of Carp and avoid recursion require Carp; Carp::croak ("$c: Can't call a method without name"); } if (!method_hand_up($name)) { # delayed load of Carp and avoid recursion require Carp; Carp::croak ("Can't call $c\-\>$name, not a valid method"); } # try one level up, but subst. bxxx() for fxxx() since MBI only got bxxx() $name =~ s/^f/b/; return &{"Math::BigInt"."::$name"}(@_); } my $bname = $name; $bname =~ s/^f/b/; $c .= "::$name"; *{$c} = \&{$bname}; &{$c}; # uses @_ } The variable class is declared as thus: my $class = "Math::BigFloat"; at line 25 in the Math::BigFloat module. bsub is located in Math::BigInt at line 1130. Perl Version 5.8.7 is distributed with this. OS is Windows, Sun-Solaris, HP-Unix Thanks, Mike
X-Scanned-BY: AMaViS-ng at bestpractical
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.5.HEAD-28632-1138914457-247.17447-4-0 [...] rt.cpan.org>
Received-SPF: neutral (x1.develooper.com: local policy)
References: <RT-Ticket-17447 [...] rt.cpan.org> <rt-3.5.HEAD-28632-1138914457-247.17447-4-0 [...] rt.cpan.org>
X-Pair-Authenticated: 84.63.11.41
Content-Type: multipart/signed; boundary="nextPart2074446.JovMcR4uj8"; protocol="application/pgp-signature"; micalg=pgp-sha1
Received: from localhost (localhost.localdomain [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id DBC654D80A1 for <cpan-bug+math-bigint [...] diesel.bestpractical.com>; Thu, 2 Feb 2006 17:54:29 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 98FD94D806A for <bug-Math-BigInt [...] rt.cpan.org>; Thu, 2 Feb 2006 17:54:29 -0500 (EST)
Received: (qmail 8955 invoked by alias); 2 Feb 2006 22:53:56 -0000
Received: from relay02.pair.com (HELO relay02.pair.com) (209.68.5.16) by la.mx.develooper.com (qpsmtpd/0.28) with SMTP; Thu, 02 Feb 2006 14:53:40 -0800
Received: (qmail 76760 invoked by uid 0); 2 Feb 2006 22:53:29 -0000
Received: from unknown (HELO bloodgate.com) (unknown) by unknown with SMTP; 2 Feb 2006 22:53:29 -0000
Delivered-To: cpan-bug+math-bigint [...] diesel.bestpractical.com
User-Agent: KMail/1.9.1
Subject: Re: [rt.cpan.org #17447] Can't call method Math::BigFloat->bsub, not a valid method
Return-Path: <nospam-abuse [...] bloodgate.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+math-bigint [...] diesel.bestpractical.com
Date: Thu, 2 Feb 2006 23:51:17 +0100
Message-Id: <200602022351.17957 [...] bloodgate.com>
To: bug-Math-BigInt [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Tels <nospam-abuse [...] bloodgate.com>
RT-Message-ID: <rt-3.5.HEAD-28600-1138920877-761.17447-0-0 [...] rt.cpan.org>
Content-Length: 0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1336
Download (untitled) / with headers
text/plain 1.3k
Moin Mike, On Thursday 02 February 2006 22:07, Guest via RT wrote: Show quoted text
> Thu Feb 02 16:07:37 2006: Request 17447 was acted upon. > Transaction: Ticket created by guest > Queue: Math-BigInt > Subject: Can't call method Math::BigFloat->bsub, not a valid > method Owner: Nobody > Requestors: mike.bidwell@jeppesen.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=17447 > > > > In the class Math::BigFloat when you have fsub called out in your > program and it goes to Math::BigFloat to do the calculation it is > suppossed to alias back to bsub. It corectly aliases but the $class > variable is not correctly set to Math::BigInt where bsub sub-routine > is declared at, it is trying to find the bsub routine in the > Math::BigFloat module instead and since it is not there it fails out.
IIRC fsub() is there just for compatibility reasons, so it would be better to always use bsub() etc. I'llhave a look if I can fix this, but at the moment I have very little time for Math::BigInt and friends :/ best wishes, tels PS: Thanx for the report! -- Signed on Thu Feb 2 23:50:11 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Remember: If the game let's you do it, it's not cheating." -- Xarax
Content-Type: application/pgp-signature
Content-Length: 481
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-24415-1173020514-1256.17447-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 124
Download (untitled) / with headers
text/plain 124b
I just released Math::BigInt 1.80 to CPAN, which fixes this issue. Thank you for your report, and sorry for the long delay.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.