Page MenuHomePhabricator

round return non-integer results on small integers
Closed, ResolvedPublic


Evaluating {{#expr: 1 round 11}} on Wikimedia wikis gives "1.00000002048" (error: ~2e-8) instead of "1". I noticed a similar problem for other integers or floating-points numbers < 1000, for precision 11, 12 and 13. I tested this on, and

On a local installation of MediaWiki after syncing MediaWiki and the ParserFunction extension at git head (configuration: 32-bit, Ubuntu, PHP 5.5.9), I cannot reproduce this issue (I get "1" as expected).

(this bug has been reported on

Event Timeline

Orlodrim raised the priority of this task from to Needs Triage.
Orlodrim updated the task description. (Show Details)
Orlodrim added a project: ParserFunctions.
Orlodrim changed Security from none to None.
Orlodrim added a subscriber: Orlodrim.
Jackmcbarn added a subscriber: Jackmcbarn.

I have a suspicion that this is HHVM-related. Every HHVM server I've tried it on has had the bug, and every Zend server has worked correctly.

Seems like it's just round 11, 12 or 13 (some basic tests)

Mainframe98 added a subscriber: Mainframe98. does no longer show this issue, nor do my tests today: (Using HHVM - PHP7 beta feature temporarily disabled)