Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-35236

Float comparison errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.x, 2.9.0
    • Fix Version/s: 2.9.0
    • Labels:
      None
    • 2.9 Status:
      Resolved
    • Previous Issue Keys:
      SAM-1641

      Description

      Findbugs identifies a number of places where floats are compared using ==

      in the form:

      data.getFinalScore() != originalFinalScore

      Due to the way floats are represented in binary this could fail as no precision is specified.

      Suggestion:

      use commons-math Precision.equals(Float 1, Float 2, Float eps)

      The question is what degree of precision should we allow?

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  dhorwitz David Horwitz
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration