Coder Social home page Coder Social logo

p5-math-bigint's People

Contributors

gregoa avatar ntyni avatar nwc10 avatar pjacklam avatar rafl avatar sjohnston avatar tels avatar

Stargazers

 avatar

Watchers

 avatar  avatar

p5-math-bigint's Issues

infinite recursion in bitwise operations

Hi,

as reported by Klaus Ethgen in https://bugs.debian.org/1012704 this hangs with recent versions of Math-BigInt:

% perl -Mbignum -e '1 | (1 >> 1)'
Deep recursion on subroutine "Math::BigInt::bior" at /usr/share/perl5/Math/BigFloat.pm line 3883.
Deep recursion on subroutine "Math::BigFloat::bior" at /usr/share/perl5/Math/BigInt.pm line 3513.

Also happens with other bitwise operations like & and ^ .

It seems to have regressed around 1.999832 (where it started to spit errors) and 1.999834 (where the errors became infinite recursion.)

Improved up/downgrading breaks LedgerSMB::PGNumber

In LedgerSMB, we have a class called LedgerSMB::PGNumber which ultimately ISA Math::BigFloat. Since this class adds a few methods, it's important that the result of each operation remains of the same class. While this used to work pretty well (mostly deployed on Debian versions), this is now broken (on Debian Bookworm). Going back to Bullseye and installing the latest Math::BigInt distribution from CPAN breaks the same way.

Reading CHANGES, I suspect 1.999830 and 1.999831: Bullseye has 1.999818 and Bookworm has 1.999838.

Could you please indicate whether the current state is permanent? If so, what is your advice as to how to deal with the situation?

Should you need to look at the code, the LedgerSMB::PGNumber code is here. It's inheriting from Math::BigFloat through here

Calling numify after bfround - change in behavior

Was previously running Math-BigInt-1.999818. Tried to upgrade and found unexpected behavior when calling numify after a bfround.

my $f = Math::BigFloat->new(123456.123456);
say $f->bfround(-2)->numify;
# 123000

Missing tags since 1.999813

As seen here https://github.com/pjacklam/p5-Math-BigInt/tags
the last tag available is 1.999813, we are already at 1.999828

Having tags is convenient to use GitHub UI to perform some quick compare for example or even from the command line.

Unfortunately I do not have permission to create these tags, I will gladly help and provide them if needed.

Thanks for considering creating these tags

subclass numeric comparison regression since 1.999836

It looks like 46d1252 / 1.999836 broke numerical equivalence of Math::BigFloat subclass instances with Math::BigFloat instances. This affects at least the LedgerSMB test suite via the PGObject-Type-BigFloat CPAN module, which is how we noticed it in https://bugs.debian.org/1043234 .

A test case is

package MyFloat;
use base qw(Math::BigFloat);
1;

print MyFloat->new(9999.99) == Math::BigFloat->new(9999.99) ? "ok\n": "not ok\n";
print Math::BigFloat->new(9999.99) == MyFloat->new(9999.99) ? "ok\n": "not ok\n";

which fails the first test (but not the second one.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.