ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4027

wrong comparison of floating point numbers in trigger function count()

    Details

      Description

      When we evaluate the "eq" operator for function count(), we consider two values equal if they are within 10^-5 of each other.

      When we evaluate the "ge" operator, we consider value A greater than or equal to another value B if "A >= B". Clearly, this is wrong, because if A is smaller than B, but within 10^-5, "ge" comparison should yield "true".

        Activity

        Hide
        Aleksandrs Saveljevs added a comment -

        Also, while fixing this issue, it would be nice to resolve the following inconsistency: trigger expressions are evaluated using an epsilon of 10^-6, but trigger function count() uses an epsilon of 10^-5. The latter is especially surprising, because all floating values are stored in the database using 4 digits after the decimal point.

        Show
        Aleksandrs Saveljevs added a comment - Also, while fixing this issue, it would be nice to resolve the following inconsistency: trigger expressions are evaluated using an epsilon of 10^-6, but trigger function count() uses an epsilon of 10^-5. The latter is especially surprising, because all floating values are stored in the database using 4 digits after the decimal point.
        Hide
        Aleksandrs Saveljevs added a comment -

        Available in development branch svn://svn.zabbix.com/branches/dev/ZBX-4027 .

        Show
        Aleksandrs Saveljevs added a comment - Available in development branch svn://svn.zabbix.com/branches/dev/ZBX-4027 .
        Show
        Aleksandrs Saveljevs added a comment - Updated documentation: http://www.zabbix.com/documentation/1.8/manual/config/triggers http://www.zabbix.com/documentation/2.0/manual/config/triggers/expression?&#operators http://www.zabbix.com/documentation/2.0/manual/appendix/triggers/functions
        Hide
        Aleksandrs Saveljevs added a comment -

        Available in pre-1.8.9 in r23119 and in pre-1.9.8 in r23121.

        Show
        Aleksandrs Saveljevs added a comment - Available in pre-1.8.9 in r23119 and in pre-1.9.8 in r23121.

          People

          • Assignee:
            Unassigned
            Reporter:
            Aleksandrs Saveljevs
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: