https://bugzilla.wikimedia.org/show_bug.cgi?id=56682

       Web browser: ---
            Bug ID: 56682
           Summary: Avoid floating point errors when manipulating decimal
                    values
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: WikidataRepo
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Floating point errors should be avoided when handling/manipulating QueryValue
and DecimalValue objects. One situation where such errors frequently show is
when adding an uncertainty margin to a base amount to comput the upper and
lower bounds of a quantity.

The errors are introduced because DecimalMath, a class that implements basic
arithmetical operation on DecimalValue objects, uses float numbers to perform
the calculations.

To avoid this, we could use the bcmath library, if it is installed.

Also, smart rounding rules could be employed to reduce the ill effects of
floating point errors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to