Use Advanced Search to search the entire archive.
[jsr363-experts] Re: Request for clarification on Unit commensurability
- From: Martin Desruisseaux <
>
- To:
- Subject: [jsr363-experts] Re: Request for clarification on Unit commensurability
- Date: Tue, 16 Dec 2014 14:43:58 +0900
- Organization: Geomatys
Le 15/12/14 20:04, Werner Keil a écrit :
>
According to this API interface
>
https://github.com/unitsofmeasurement/unit-api/blob/master/src/main/java/javax/measure/quantity/Torque.java
>
it doesn't, and since there are two different classes, Java would not
>
consider them equal either;-)
Energy and Torque do have the same dimension, and the Dimension javadoc
said nothing about that. I repeat my request: what is the RI behavior
regarding that? Does Unit.isCompatible(Unit) returns true when comparing
Energy and Torque units?
I'm not asking for change - I'm trying to document our behaviour. We are
asking for comments, so we must said what we are doing!!!
>
(...snip...) http://www.dagego.de/info_waermebedarf.html (...snip...)
>
where
>
Quantity<Energy> energy = (Quantity<Energy>) volume.multiply(temperature);
*Wrong:* the dimensions are clearly incompatibles. I suspect that the
equations given in the above page have a hidden constant, something like
the Boltzmann constant. In any case the above Java code is invalid and
must be rejected. Indeed, I already deleted this example from the
specification yesterday (and was horrified when I saw it).
To make the above code example valid, you would probably need to
multiply by the units of the Boltzmann constant, or something along that
line.
Martin