Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

sprintf and NaN, Mu, Any and Nil #4537

Open p6rt opened 9 years ago

p6rt commented 9 years ago

Migrated from rt.perl.org#126067 (status was 'open')

Searchable as RT126067$

p6rt commented 9 years ago

From @gfldex

say sprintf('%f %f %f %f', Mu, Any, Nil, NaN); # output​: rakudo-moar ed47bb​: OUTPUT«0.000000 0.000000 0.000000 0.000000␤» # rakudo-jvm ed47bb​: OUTPUT«java.lang.NumberFormatException​: For input string​: "nan"␤» # NaN should numify to NaN for sure and so may Mu, Any and Nil

p6rt commented 8 years ago

From @usev6

On Wed Sep 16 04​:45​:58 2015, gfldex wrote​:

say sprintf('%f %f %f %f', Mu, Any, Nil, NaN); # output​: rakudo-moar ed47bb​: OUTPUT«0.000000 0.000000 0.000000 0.000000␤» # rakudo-jvm ed47bb​: OUTPUT«java.lang.NumberFormatException​: For input string​: "nan"␤» # NaN should numify to NaN for sure and so may Mu, Any and Nil

The output for NaN is NaN now, the rest is unchanged​:

$ perl6-m -e 'say sprintf("%f %f %f %f", Mu, Any, Nil, NaN);' 0.000000 0.000000 0.000000 NaN

p6rt commented 8 years ago

The RT System itself - Status changed from 'new' to 'open'

lizmat commented 1 year ago

My idea is to not allow Mu as a value to sprintf: each value should be Cool in the RakuAST implementation of sprintf in 6.e.

This would mean that a Mu would cause a typecheck error.