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 %f on -0e0 omits sign #5522

Closed
p6rt opened this issue Aug 2, 2016 · 4 comments
Closed

sprintf %f on -0e0 omits sign #5522

p6rt opened this issue Aug 2, 2016 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2016

Migrated from rt.perl.org#128821 (status was 'resolved')

Searchable as RT128821$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

From zefram@fysh.org

0e0.perl
0e0
(-0e0.perl)
-0
sprintf("%f", 0e0)
0.000000
sprintf("%f", -0e0)
0.000000

The Num type is correctly distinguishing between positive and negative
zero, but sprintf %f is not representing the sign bit in its output.
sprintf %f on negative zero should produce output starting with a "-".

-zefram

@p6rt
Copy link
Author

p6rt commented Nov 26, 2016

From @zoffixznet

On Tue, 02 Aug 2016 11​:20​:19 -0700, zefram@​fysh.org wrote​:

0e0.perl
0e0
(-0e0.perl)
-0
sprintf("%f", 0e0)
0.000000
sprintf("%f", -0e0)
0.000000

The Num type is correctly distinguishing between positive and negative
zero, but sprintf %f is not representing the sign bit in its output.
sprintf %f on negative zero should produce output starting with a "-".

-zefram

Thanks for the report. This is now fixed \o/

nqp​: Raku/nqp@ddebbfa959
rakudo​: rakudo/rakudo@f1263abc27
tests​: Raku/roast@795fc1f3b3 / rakudo/rakudo@2efeda0597

Cheers,
ZZ

@p6rt
Copy link
Author

p6rt commented Nov 26, 2016

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

@p6rt
Copy link
Author

p6rt commented Nov 26, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant