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
"-0" inconsistent about signedness #13296
Comments
From zefram@fysh.orgCreated by zefram@fysh.orgSince Perl 5.17.1, the string "-0" appears to be a negative zero if it is $ perl -lwe 'printf "%+.f%+.f\n", "-0", - - "-0"' This is unlike the pure floating-point value -0.0, which is consistently $ perl -lwe 'printf "%+.f%+.f\n", -0.0, - - -0.0' Also unlike the pure integer -0, which is consistently unsigned: $ perl -lwe 'printf "%+.f%+.f\n", -0, - - -0' "-0" is presumably meant to behave numerically like one or other of the In fact, it's worse: whether a "-0" string appears signed or not $ perl -lwe '$a="-0"; sprintf "%+.f\n", $a; my $b = "-0"; -$b; printf "%+.f%+.f%+.f\n", $a,- $a, - -$a; printf "%+.f%+.f%+.f\n", $b,- $b, - -$b;' Perl Info
|
Migrated from rt.perl.org#119935 (status was 'new')
Searchable as RT119935$
The text was updated successfully, but these errors were encountered: