in reply to Deep recursion on subroutine with bignum and Astro::Units
On a general note, I consider it unwise of the module author to use bignum and doubly-unwise for them to recommend that everyone using their module should do so. Each of bignum, bigint, bigrat can be fine and useful for simple one-liners, but for anything more complex they are very likely to cause problems.
For this specific issue, note that the current Math::BigInt maintainer has made wide-reaching changes multiple times in recent months in an attempt to make the interactions between the different classes behave more sanely in the context of use bignum; it is not clear to me whether it has now reached a stable point. So you may want to try both more recent and older versions of the distribution - check the changelog for references to "upgrading and downgrading".
For getting the calculations you are using to work reliably, I suggest ditching bignum; instead instantiate your numbers as Math::BigFloat, and hope that the use of bignum inside Astro::Units doesn't result in unexpected conversions to Math::BigInt or Math::BigRat.
Note that you should also be able to change the Math::BigFloat configuration after loading Astro::Units, if the latter's choices are not suitable for your needs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Deep recursion on subroutine with bignum and Astro::Units
by Anonymous Monk on Jan 21, 2023 at 17:38 UTC |