I wanted to create "bignum usability" SOPW question, but then the SS landed me right here, -- very fresh thread. This pragma is in the core, but how usable/advised/maintained it is?

use strict; use warnings; use feature 'say'; use bignum; # (1) #use bignum downgrade => "Math::BigInt", upgrade => "Math::BigI +nt"; ## (2) #use bigint; say $^V; say my $x = 21778071482940061661655974875633165533182; say my $y = $x / 2;

...

v5.38.0 21778071482940061661655974875633165533182 10889035741470030830827987437816582766590

off-by-one error. Using commented-out lines instead gives me (1):

Deep recursion on subroutine "Math::BigInt::bdiv" at C:/berrybrew/stra +wberry-perl-5.38.0.1-64bit-PDL/perl/site/lib/Math/BigInt.pm line 2229

and the Perl process hangs, or (2):

21778071482940061661655974875633165533182 10889035741470030830827987437816582766591

i.e. "don't use bignum if bigint suffices" will produce the correct answer, but doesn't smell quite right


In reply to Re: bignum usage? by Anonymous Monk
in thread bignum usage? by rkd257

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.