Last modified: 2010-03-18 11:35:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24866, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22866 - {{#ifexpr: (-1)*0 | true | false }} == true
{{#ifexpr: (-1)*0 | true | false }} == true
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-17 18:24 UTC by STyx
Modified: 2010-03-18 11:35 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description STyx 2010-03-17 18:24:28 UTC
Unexpected results :

    {{#ifexpr: -0 | yes | no }} → no
    {{#ifexpr: 1*0 | yes | no }} → no
    {{#ifexpr: -1*0 | yes | no }} → yes 

See http://www.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&diff=310071&oldid=307495
Comment 1 STyx 2010-03-17 18:26:02 UTC
Maybe related to bug 6356 and Bug 18233 ?
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2010-03-17 18:41:03 UTC
Unlikely.  I don't understand the code well enough to see what's going wrong here, though.  There should never be rounding errors when multiplying by 0, surely?
Comment 3 Platonides 2010-03-17 18:46:58 UTC
-0 is normalised to 0 but -1*0 is kept as -0, which trigger the yes
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2010-03-17 19:15:22 UTC
Where is this normalization done?  Also, why is -0 a yes?  (bool)(-0) in PHP is false.
Comment 5 Alexandre Emsenhuber [IAlex] 2010-03-18 11:35:58 UTC
Fixed in r63906.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links