Coverity analysis defect 185632: Result is not floating-point

XMLWordPrintableJSON

    • Storage Engines - Foundations
    • SE Foundations - Q4+ Backlog
    • None

      Result is not floating-point

      The result of the division is truncated to an integer (a whole number), which is usually a loss of precision in a calculation. When dividing two values of integer types, integer division is used, which ignores any remainder. When such a result is used in a context expecting a floating-point number, it is likely that floating-point division was intended.
      /ext/test/key_provider/key_provider.c:201: UNINTENDED_INTEGER_DIVISION 185632 Dividing integer expressions "(now - kp->state.key_time) * 1000000UL" and "1000000UL", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.

            Assignee:
            Salman Javed
            Reporter:
            Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: