Skip to content

inf, -inf, nan returned as strings and not floats #5

Description

@jarvisms

It's possible for the DCS server to return Inf, -Inf and NaN for totalValue and periodValue with the get_readings method. This can occur when virtual meters give a divide by zero, or calibration readings are not set up correctly so are generally erroneous situations, however these are none-the-less valid values of IEEE 754 floating points and Python's representation of floats. These are currently returned as strings and not floats and probably should be returned as such.

Caveat though is that returning a string will cause an immediate exception when attempting to do most (but not all) arithmetic or numeric comparisons while the appropriate floats will not allowing more mysterious behaviour to manifest itself later in downstream code making it harder to trace.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions