Skip to content

Some math operations on temperatures with different units could give an erroneous result #74

Open
@fabiengagne

Description

@fabiengagne

I think the following should result in 97 °C ?

(Unitwise(100, "°C") - Unitwise(3, "K"))
=> #<Unitwise::Measurement value=370.15 unit=°C>

Further,

((Unitwise(100, "°C") - Unitwise(3, "K"))).convert_to("°C")
 #<Unitwise::Measurement value=370.15 unit=°C>
((Unitwise(100, "°C") - Unitwise(3, "K"))).convert_to("K")
 #<Unitwise::Measurement value=643.3 unit=K>

I will post more detail about my original suggestion in a few minutes to better depict my "delta-something" use case.

Originally posted by @fabiengagne in #73 (comment)

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