Hi BR. Thanks for the reply. The used of chinese as an instruction works in my code, the result is a long number, 954846259588805228035541587771, much greater than 2^64. My question is how to ensure that the result is used properly throughout any programming thereafter, and how the result is shown using print or printf.

using the instruction print $crt1 -> bdstr(); produces the same result as the say instruction, which makes me think that probably $crt1 is being used correctly, but how can that instruction be used with a more complex print or printf line, whose output reads "crt solution is (put correct long number here)". Below is proof that the use of bdstr works

#!/usr/bin/env perl use warnings; use strict; use Math::BigFloat lib=>"GMP"; use Math::Prime::Util qw/:all/; use Math::BigInt qw/:constant/; use feature ':5.10'; my $crt1=chinese([1,2],[1,3],[1,5],[5,7],[4,11],[9,13],[0,17],[14,19], +[22,23],[28,29],[28,31],[27,37],[3,41],[15,43],[9,47],[51,53],[55,59] +,[35,61],[17,67],[35,71],[67,73],[28,79]); say $crt1; print $crt1 -> bdstr();

In reply to Re^2: Using big numbers correctly by robert44444uk
in thread Using big numbers correctly by robert44444uk

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.