Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm doing some stuff with the module Astro::Units whose pod suggests to explicitly use bignum. The program works fine until I try doing some simple arithmetic. I can't reproduce the error with an SSCE so here are the errors and the calculations causing them:
Deep recursion on subroutine "Math::BigFloat::bdiv" at /5.26.2/Math/BigInt.pm line 1867.
Deep recursion on subroutine "Math::BigInt::Calc::_lsft" at /5.26.2/Math/BigFloat.pm line 1948.
Deep recursion on anonymous subroutine at /5.26.2/Math/BigInt/Calc.pm line 1412.
Deep recursion on subroutine "Math::BigInt::bdiv" at /5.26.2/Math/BigInt.pm line 54.
Here's the math and the results when loading and not loading (but not directly using) both bignum and Astro::Units:
perl -le '$Da=406700; $Dp=356400; $Dm=361918; $pct = ($Da - $Dm) / ($D +a - $Dp); print $pct'
0.890298210735586
perl -Mbignum -le '$Da=406700; $Dp=356400; $Dm=361918; $pct = ($Da - $ +Dm) / ($Da - $Dp); print $pct'
0.8902982107355864811133200795228628230616
perl -Mbignum -MAstro::Units -le '$Da=406700; $Dp=356400; $Dm=361918; +$pct = ($Da - $Dm) / ($Da - $Dp); print $pct'
0.8902982
perl -MAstro::Units -le '$Da=406700; $Dp=356400; $Dm=361918; $pct = ($ +Da - $Dm) / ($Da - $Dp); print $pct'
0.890298210735586

Can anyone see what's going on here? That third result is puzzling. What could be causing such errors? Thanks!


In reply to Deep recursion on subroutine with bignum and Astro::Units by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found