Skip to content

Floating point error with Temperature. #25

Description

@naomiconnolly-noaa

Using NUCOS in a programatic setting where units are sometime presented to such that it converts to the same unit already provided, for example converting 15 F to F. This seems to work in most cases but I have discovered one that illustrates an area we should improve.

The line below returns 14.9.

nucos.convert('Temperature', 'F', 'F', 15);

Perhaps a no-op should be added that if incoming and outgoing units are the same simply return the input value. Or attempt to sort the floating point conversion in a meaningful way. 16 F seems fine, as does 14 F.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions