Last modified: 2013-09-08 22:57:04 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 T55930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53930 - Round, floor, and ceil on negative numbers may give -0 (negative zero) for the result
Round, floor, and ceil on negative numbers may give -0 (negative zero) for th...
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Unprioritized minor (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.mediawiki.org/w/index.php...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-08 22:38 UTC by Will Murray (Willscrlt)
Modified: 2013-09-08 22:57 UTC (History)
2 users (show)

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


Attachments

Description Will Murray (Willscrlt) 2013-09-08 22:38:10 UTC
I documented this in the [https://www.mediawiki.org/w/index.php?title=Help:Extension:ParserFunctions&oldid=778504 Parser Functions Help: Rounding] section.

If you use the function '''round''', '''floor''', or '''ceil''' with a negative value that should correctly round to zero, you end up with a negative zero instead.

While mathematically, zero and negative zero are identical, conceptually and possibly in comparison logic, they are not the same thing.

Is (-0 == 0) true or false? It should evaluate as true, but it would be much better if the rounding resulted in an unambiguous "0", so that this question never needs to come up.

[Note: This is my first bug report here, so if I am missing anything or did something wrong, please be gentle with me. :-) ]
Comment 1 Technical 13 2013-09-08 22:57:04 UTC
https://www.mediawiki.org/w/index.php?title=User%3ATechnical_13%2FSandBox&diff=778511&oldid=708467 says this isn't an issue... (-0 == 0) as far as the parser is concerned.

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


Navigation
Links