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!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.