DateTime::Format::Epoch microsecond output uses scientific notation
まだ誰も着手していません。
評価
調査の方向性
t/004_nano.t の焦点となる失敗から始め、最小限の算術再現プログラムを両方のバックエンドで実行します。1e6 の乗数によって実行される数値表現と文字列化の経路を追跡します。再現プログラムが標準 Perl と同じ箇所では十進表記を使用し、それ以外では科学表記を維持し、DateTime::Format::Epoch の完全なテストスイートが 133 個すべてのテストに合格すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
DateTime::Format::Epoch 0.16 fails one upstream test under PerlOnJava because a large integer-valued numeric result is stringified in scientific notation instead of decimal notation.
Reproduction
Run the normal DateTime::Format::Epoch 0.16 test suite.
The focused failing test is t/004_nano.t, which constructs a formatter with unit => "microseconds" and formats a DateTime corresponding to 1051470597800000 microseconds since the epoch.
A minimal arithmetic reproducer is:
my $x = 1051470597;
$x *= 1e6;
$x += int(0.8 * 1e6);
print "[$x]\\n";
Expected result
System Perl prints:
[1051470597800000]
The complete upstream suite passes under system Perl: 20 files and 133 tests.
Actual result
PerlOnJava prints:
[1.0514705978e+15]
The CPAN test failure is:
# Failed test '"now" (micro)'
# at t/004_nano.t line 32.
# got: '1.0514705978e+15'
# expected: '1051470597800000'
The archived compatibility run recorded 1 failed test program and 1 failed subtest out of 20 programs and 133 subtests. The focused arithmetic reproducer produces the same scientific notation on both the JVM and interpreter backends.
Likely root cause
DateTime::Format::Epoch maps microseconds to the numeric literal 1e6. With the default integer mode for this unit, Perl preserves the integer-valued result in decimal string form. PerlOnJava promotes or retains the calculation as a floating-point scalar and formats the large integer-valued result using scientific notation.
This is a shared numeric representation/stringification compatibility issue, not a CPAN distribution defect, missing prerequisite, timeout, or native-code dependency.
Acceptance criteria
- Integer-valued arithmetic such as the reproducer stringifies as decimal rather than scientific notation when Perl does so.
DateTime::Format::Epoch0.16 passes all 133 upstream tests on both backends.- Add a project-owned regression test for large integer-valued arithmetic involving a
1e6multiplier and decimal stringification. - Preserve scientific notation for values and contexts where standard Perl actually uses it.
Evidence
- CPAN run:
20260918-141920-96054 - Distribution:
DateTime-Format-Epoch-0.16 - Failing test:
t/004_nano.t, test 8 ("now" (micro)) - System Perl: PASS, 20 files / 133 tests
- PerlOnJava: FAIL, 1 file / 1 subtest
- JVM and interpreter: focused arithmetic reproducer confirmed
Related issue check
Issue #1283 concerns omitted optional arguments becoming explicit undef in DateTime::Format::Builder; it is related only by the DateTime ecosystem and does not cover this numeric-formatting failure. No duplicate issue was found for this distribution, test, or scientific-notation symptom.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 6
- 平均マージ
- 5時間 25分
- マージ済み PR(30日)
- 157
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
area:cpan-port area:unicode bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fglock/PerlOnJava#1341 ·
-
area:cpan-port bug
難易度 4/5 3〜5日 初心者へのやさしさ 44/100
fglock/PerlOnJava#1459 ·
-
area:cpan-port bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
fglock/PerlOnJava#1457 ·
-
bug high-impact
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
fglock/PerlOnJava#1456 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 72/100
fglock/PerlOnJava#1455 ·
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
1.severity: security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
api7/lua-resty-saml#63 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100