Page MenuHomePhabricator

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

Description

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 fr.wikipedia.org, en.wikipedia.org and test.wikimedia.org.

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 https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Le_Bistro/3_d%C3%A9cembre_2014#round)

Event Timeline

Orlodrim created this task.Dec 3 2014, 7:38 PM
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.

fbstj added a subscriber: fbstj.Dec 8 2014, 8:21 PM

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

Se4598 added a subscriber: Se4598.Dec 27 2014, 7:42 PM
Aklapper triaged this task as Low priority.Mar 22 2015, 4:57 PM
fbstj removed a subscriber: fbstj.Dec 15 2015, 2:56 PM
Mainframe98 closed this task as Resolved.Mar 18 2019, 1:58 PM
Mainframe98 added a subscriber: Mainframe98.

https://www.mediawiki.org/wiki/User:Fbstj/T76641 does no longer show this issue, nor do my tests today: https://test.wikipedia.org/wiki/User:Mainframe98/Sandbox. (Using HHVM - PHP7 beta feature temporarily disabled)

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMar 18 2019, 1:58 PM