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

Returns "0.0" instead of "0" for a zero double #1191

Closed
wants to merge 1 commit into from

Conversation

cognominal
Copy link
Contributor

so that a roundtrip thru stringification is a noop.

That is the following prints 1
nqp -e 'my $i := 0.0; say(nqp::eqaddr($i.WHAT, (+~$i).WHAT))'

I was unable to test it because I was not able to build nqp with the modified
moar on catalina.
perl Configure.pl --prefix=/usr --backends=moar --with-moar=/Users/cog/git/MoarVM/moar
make: *** No rule to make target /Users/cog/git/MoarVM/../share/nqp/lib/MAST/Nodes.nqp', needed by gen/moar/stage1/MASTNodes.nqp'. Stop.

so that a roundtrip thru stringification is a noop.

That is the following prints 1
nqp -e 'my $i := 0.0; say(nqp::eqaddr($i.WHAT, (+~$i).WHAT))'

I was unable to test it because I was not able to build nqp with the modified
moar on catalina.
perl Configure.pl --prefix=/usr --backends=moar --with-moar=/Users/cog/git/MoarVM/moar
make: *** No rule to make target `/Users/cog/git/MoarVM/../share/nqp/lib/MAST/Nodes.nqp', needed by `gen/moar/stage1/MASTNodes.nqp'.  Stop.
@MasterDuke17
Copy link
Contributor

NQP

Test Summary Report
-------------------
t/nqp/109-coercions.t                (Wstat: 0 Tests: 28 Failed: 3)
  Failed tests:  14, 18-19
t/hll/06-sprintf.t                   (Wstat: 0 Tests: 287 Failed: 17)
  Failed tests:  98-108, 152, 206, 274-277
t/qast/01-qast.t                     (Wstat: 0 Tests: 178 Failed: 1)
  Failed test:  29
Files=145, Tests=13303,  5 wallclock secs ( 0.84 usr  0.15 sys + 25.73 cusr  1.98 csys = 28.70 CPU)

Rakudo

Test Summary Report
-------------------
t/spec/S03-operators/arith.t                                    (Wstat: 768 Tests: 158 Failed: 3)
  Failed tests:  100, 109, 112
  Non-zero exit status: 3
t/spec/S03-metaops/hyper.rakudo.moar                            (Wstat: 512 Tests: 410 Failed: 2)
  Failed tests:  404-405
  Non-zero exit status: 2
t/spec/S09-typed-arrays/native-num.rakudo.moar                  (Wstat: 2304 Tests: 457 Failed: 9)
  Failed tests:  136-138, 288-290, 440-442
  Non-zero exit status: 9
t/spec/S32-num/exp.t                                            (Wstat: 512 Tests: 72 Failed: 2)
  Failed tests:  18, 28
  Non-zero exit status: 2
t/spec/S32-num/complex.t                                        (Wstat: 256 Tests: 555 Failed: 1)
  Failed test:  511
  Non-zero exit status: 1
t/spec/S32-num/negative-zero.t                                  (Wstat: 512 Tests: 20 Failed: 2)
  Failed tests:  1, 11
  Non-zero exit status: 2
t/spec/S32-num/real-bridge.t                                    (Wstat: 1280 Tests: 201 Failed: 5)
  Failed tests:  141, 145-148
  Non-zero exit status: 5
t/spec/S32-num/stringify.rakudo.moar                            (Wstat: 3072 Tests: 62 Failed: 12)
  Failed tests:  25-28, 33-36, 41-44
  Non-zero exit status: 12
t/spec/S32-str/sprintf.t                                        (Wstat: 3072 Tests: 174 Failed: 12)
  Failed tests:  69-70, 79-80, 89-90, 99-100, 109-110, 173-174
  Non-zero exit status: 12
t/spec/S32-trig/cosech.t                                        (Wstat: 512 Tests: 146 Failed: 2)
  Failed tests:  61-62
  Non-zero exit status: 2
t/spec/S32-trig/sech.t                                          (Wstat: 512 Tests: 154 Failed: 2)
  Failed tests:  65-66
  Non-zero exit status: 2
t/spec/S32-str/sprintf-e.t                                      (Wstat: 65024 Tests: 2282 Failed: 2282)
  Failed tests:  1-2282
  Non-zero exit status: 254
t/spec/integration/advent2011-day15.t                           (Wstat: 256 Tests: 9 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
t/spec/integration/advent2013-day15.t                           (Wstat: 256 Tests: 30 Failed: 1)
  Failed test:  23
  Non-zero exit status: 1
Files=1274, Tests=109505, 142 wallclock secs (17.00 usr  2.31 sys + 1809.54 cusr 114.69 csys = 1943.54 CPU)

@cognominal
Copy link
Contributor Author

The pull request was incomplete. Dealt only with the 0.0 case.
A lot of code relies on the current behaviour as shown by masterduke test dumps.
Lizmat notes the correct behaviour is obtained with .perl but that .gist current behaviour deserves opening an issue.
nqp only purpose is used to bootstrap Perl 6 so it is pointless to argue what is the correct behaviour here.
Thx for the feedback.

closing conclusion by lizmat
https://colabti.org/irclogger/irclogger_log/perl6-dev?date=2019-10-10#l148

@cognominal cognominal closed this Oct 10, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants