mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare/unit] Handle kelvin with prefix
Units derived from kelvin (mK, cK, ...) were handled like Celsius and Fahrenheit, causing a bug where multiplications such as 2*pi*_cK to simplify as undef.
This commit is contained in:
committed by
EmilieNumworks
parent
fa523c25c9
commit
9b3f7edfcd
@@ -869,7 +869,7 @@ Expression Unit::shallowReduce(ExpressionNode::ReductionContext reductionContext
|
||||
* (6) -123_°C->_K
|
||||
* (7) Right member of a unit convert - this is handled above, as
|
||||
* UnitConversion is set to None in this case. */
|
||||
if (node()->representative()->dimensionVector() == TemperatureRepresentative::Default().dimensionVector()) {
|
||||
if (node()->representative()->dimensionVector() == TemperatureRepresentative::Default().dimensionVector() && node()->representative() != k_temperatureRepresentatives + k_kelvinRepresentativeIndex) {
|
||||
Expression p = parent();
|
||||
if (p.isUninitialized() || p.type() == ExpressionNode::Type::UnitConvert) {
|
||||
// Form (1) and (2)
|
||||
|
||||
Reference in New Issue
Block a user