Skip to content

Automatically generate "origin displacement unit" #714

@chiphogg

Description

@chiphogg

When two units have a nonzero origin offset, that offset is basically an implicit unit. If we include it in common unit calculations, we will be able to produce the most efficient result for "common unit" calculations.

For example, consider computing ((0°C - 0 K) + (0°F - 0°C)). This table shows that mp-units produces an underlying value of 2298350, because it happens to store the temperature offset in millikelvins as an implementation detail. Au produces 45967, which is the most efficient possible result.

This may be challenging because mp-units has rejected using a "zero" type, whereas the origin displacement between any two units is usually zero. But this could probably be worked around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions