Skip to content

Result of A + B shall be determinist #98

@desruisseaux

Description

@desruisseaux

The result of Quantity.add(Quantity) shall be numerically equivalent for all implementations. "Numerically equivalent" means that they shall have the same numerical value (ignoring rounding errors) after conversion to the same unit by Quantity.to(Unit).

Example: 1 m + 2 cm = 1.02 m or 102 cm, at implementation choice. But can not be 2 meters.

The problem become more tricky with temperature: 1°C + 2°C may be 3°C or 276.15 °C, depending on whether the 1°C and 2°C quantities are temperature measurements or temperature increments. It is not the purpose of this issue to decide which interpretation should be applied. The purpose of this issue is to state that whatever interpretation is choose, the specification should describe it with enough details for ensuring that all implementations produce numerically equivalent results.

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