Bug 275722

Summary: lang/perl5.36 - incorrect printf/sprintf output of bignum values
Product: Ports & Packages Reporter: vvv <work+freebsd>
Component: Individual Port(s)Assignee: Mathieu Arnold <mat>
Status: New ---    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (mat)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description vvv 2023-12-12 14:35:02 UTC
perl5-5.36.1_1 package contains bignum/bigint/bigfloat modules which work incorrectly with printf/sprintf. Test script:

------------------------------
#!/usr/bin/env perl

use strict;
use warnings;
use bignum;

my $a = 0.1;
my $b = sprintf("%0.1f", $a);
print "$a = $b\n";
------------------------------

Expected output is "0.1 = 0.1".
Actual output is "0.1 = 0.0".

Workaround:
pkg install p5-Math-BigInt
The package provides new versions of bignum/bigint/bigfloat modules.
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2023-12-13 10:26:23 UTC
The Perl provided is not patched, so, please, report this upstream, Perl has a perlbug utility to make things easier.