Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprintf and NaN, Mu, Any and Nil #4537

Open
p6rt opened this issue Sep 16, 2015 · 4 comments
Open

sprintf and NaN, Mu, Any and Nil #4537

p6rt opened this issue Sep 16, 2015 · 4 comments
Labels
RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented Sep 16, 2015

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

Searchable as RT126067$

@p6rt
Copy link
Author

p6rt commented Sep 16, 2015

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
Copy link
Author

p6rt commented Nov 12, 2015

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
Copy link
Author

p6rt commented Nov 12, 2015

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

@p6rt p6rt added the RFC Request For Comments label Jan 5, 2020
@lizmat
Copy link
Contributor

lizmat commented Jun 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

2 participants