Bug 275722 - lang/perl5.36 - incorrect printf/sprintf output of bignum values
Summary: lang/perl5.36 - incorrect printf/sprintf output of bignum values
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-12 14:35 UTC by vvv
Modified: 2023-12-13 10:26 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (mat)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.