Page MenuHomePhabricator

{{#ifexpr: (-1)*0 | true | false }} == true
Closed, ResolvedPublic

Description

Author: loustyx

Description:
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


Version: unspecified
Severity: major

Details

Reference
bz22866

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:07 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz22866.
bzimport added a subscriber: Unknown Object (MLST).

loustyx wrote:

Maybe related to bug 6356 and Bug 18233 ?

ayg wrote:

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?

-0 is normalised to 0 but -1*0 is kept as -0, which trigger the yes

ayg wrote:

Where is this normalization done? Also, why is -0 a yes? (bool)(-0) in PHP is false.