This is a staging repository for work on Units handling in ICU, and tracks some ongoing development. Jira remains the primary Issue Tracker for ICU though! For the ICU project proper, see https://github.com/unicode-org/icu.
0
stars
0
forks
source link
Determine how we want to handle "undefined behaviour" #127
Various "meaningless" corner cases are possible with unit conversions. Some examples:
Use of temperature in mixed units
Use of prefixes with temperatures (units with offsets)
We don't currently fail for such cases. To be determined:
Do we want to check for these cases and return errors?
Do we want to leave this behaviour undefined?
If undefined, do we want to add unit tests that demonstrate the current behaviour? (And thereby arguably "locks in" the undefined behaviour? Or leave in comment-out or otherwise-disabled unit tests that show the current behaviour?)
@younies suggests treating square Celsius or Fahrenheit as a relative quantity, in which case we can safely drop the offset. Or we could add separate units or another API parameter. @hugovdm compares this to date vs. duration, where we should have separate types.
@sffc thinks we should use an error code here since it isn't clear what the correct behavior should be. @hugovdm suggests setting the error code while constructing the UnitConverter.
Various "meaningless" corner cases are possible with unit conversions. Some examples:
We don't currently fail for such cases. To be determined: