You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by saying:
I believe "linear" is not the correct term. Celsius and Fahrenheit are linearly related, but explicitly not supported here, and linear is also not used for what you call "reciprocal" relationships. I think "proportional" is a more precise term, as that is by definition offset-free, and "inverse proportional" is a correct term for the reciprocal relationships.
Therefore, we need to discuss the name of this class.
The text was updated successfully, but these errors were encountered:
This PR introduces the `UnitsConverter`, a `struct` that wraps three
distinct types of unit converters:
1. **ProportionalConverter**: Handles conversions between units where
the relationship is `unit1 = CR * unit2`.
2. **ReciprocalConverter**: Handles conversions between units where the
relationship is `unit1 = 1 / (CR * unit2)`.
3. **OffsetConverter**: Handles conversions with an offset, following
the formula `unit1 = CR * unit2 + Offset`.
_Note: CR refers to the Conversion Rate._
Additionally, this PR includes an organizational change:
- The `ConverterFactory` has been relocated to a separate folder,
enhancing the overall clarity and structure of the implementation.
Fixes: #4576
Currently, we are using the
LinearConverter
to convert non-offset units.However, @robertbastian has expressed opposition to this approach in his comment: https://github.com/unicode-org/icu4x/pull/4404/files#r1474932838.
by saying:
I believe "linear" is not the correct term. Celsius and Fahrenheit are linearly related, but explicitly not supported here, and linear is also not used for what you call "reciprocal" relationships. I think "proportional" is a more precise term, as that is by definition offset-free, and "inverse proportional" is a correct term for the reciprocal relationships.
Therefore, we need to discuss the name of this class.
The text was updated successfully, but these errors were encountered: