perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

perl5.36 - incorrect printf/sprintf output of bignum values

Open vvv2542 opened this issue 2 years ago • 4 comments

perl5-5.36.1 contains bignum/bigint/bigfloat modules which work incorrectly with printf/sprintf. Test script:

perl -Mbignum -we 'printf "%0.1f\n", 0.1'

Expected result is "0.1". Actual result is "0.0".

Module versions: bignum 0.65 bigint 0.65 bigfloat 0.65 Math::BigInt 1.999830 Math::BigFloat 1.999830

Workaround: install Math-BigInt-2.002001.

vvv2542 avatar Dec 13 '23 12:12 vvv2542

-Mbignum -we 'printf "%0.1f\n", 0.1'

This version of Math-BigInt has already been brought into the Perl core distribution. The fix will appear in perl-5.39.6 later this month and in production release perl-5.40.0 in May.

I believe this ticket is closable.

jkeenan avatar Dec 13 '23 13:12 jkeenan

What about 5.36 and 5.38?

vvv2542 avatar Dec 13 '23 13:12 vvv2542

On Wed, Dec 13, 2023 at 05:20:49AM -0800, vvv2542 wrote:

What about 5.36 and 5.38?

As a general rule we do not include newer versions of CPAN distributions in maintenance releases. This is for two main reasons.

First, it is relatively easy for an end user themselves to install a newer version of a CPAN distribution against a perl installation. It is harder to revert to an older version.

Second, we try to restrict changes to maintenance releases to the minimum required for specific bug fixes which are being backported. Including a complete new release of a CPAN module may include many changes, not just bugfixes. Such changes may not always be completely backwards compatible.

-- More than any other time in history, mankind faces a crossroads. One path leads to despair and utter hopelessness. The other, to total extinction. Let us pray we have the wisdom to choose correctly. -- Woody Allen

iabyn avatar Dec 13 '23 13:12 iabyn

Thank you. It looks reasonable if we are talking about new features. But here is serious bug. It will be better to exclude it from perl bundle at all. In this case we will get error about missing module and can fix it by installing fresh module. Now after updating the perl we have software that looks working but produces the wrong result. We have sad results if the software is billing or statistics. Perhaps it makes sense not to update the module to the latest version but to backport the fix.

vvv2542 avatar Dec 13 '23 15:12 vvv2542

@iabyn explained the reasons for our policy two months ago. Closing.

jkeenan avatar Mar 01 '24 00:03 jkeenan