Temperatures can be converted to and from degree Celsius and Fahrenheit.
When used in non-trivial calculations, they are always reduced to undef,
as the rules for manipulating relative scales are not well defined.
Change-Id: If59e224a0e7f940b421bc894bbe2279c90f38d04
Implemented std::nextafter to replace hand made one.
Methods next and previous are no longer making the difference between -0
and +0
Change-Id: I42e1a073623b70656d9df954694803840cf3088c
Method characteristicXHalfRange was used to compute the range on which
to display cartesian function in Graph. With the new zoom algorithm,
this method is deprecated.
Change-Id: Ic681fab8d58d0f5628a94302a7b49dacaaa1a6a3
With the imperial system selected, volumes are expressed as volume in
Calculation's results, instead of cubic lengths.
Change-Id: Ib6c0a1a595dce8ae8db6371b41af818b3fdc6236
In additional outputs, a volume is now splitted as :
_gal+_qt+_pt+_cup
instead of :
_gal+_cup+_floz
Change-Id: I5020afbab23be6331d8a8742fd6295db178f0b37
1. Information about a unit's dimension now uses inheritance.
_m is an instance of DistanceAlias, which is derived from Alias.
A UnitNode now keeps a pointer to an Alias and one to a Prefix.
All aliases are still defined as constexpr.
This cleans up a lot of the code used namely for computing the
additional outputs in Calculation.
2. Instead of being defined with a string, each unit is described by its
ratio with the base SI unit (ex: _L is 0.001 instead of "0.001_m^3").
This greatly speeds up the calculations using units, as the algorithm
to find the best unit used to parse the definition.
Change-Id: I4d6ed6ad4cb967026a3f01a335aec270066e2b9f
This fixes issues #1541. Formulas as asin(sin(X)) with X a large number
were failling to simplify themselves into the image interval of asin
ex : previous version asin(sin(6)) = 6
new version asin(sin(6)) = -2pi+6
Change-Id: Ia6200b67914224cecd2cd943bcf9bc2ff6e0447a
We now compute the value of the mantissa in double (instead of float)
to limit conversion error occuring for big numbers.
Change-Id: Ia61c052f0bc4a9196c53e2c7900eb48e3343d39c
New tests compute derivatives while replacing symbols with their definitions or undefined, as the device does.
Change-Id: I99179bf6540182ff929938fb96a00a1ed2fbcf49
Derivation now computes as expected on logarithms, as long as their base is not a function of the derivation variable.
Change-Id: Ia56da1c1151c0ddf3887be84ddb4bd02664c5188
Added a method unaryFunctionDifferential to ExpressionNode and Expression, to be implemented by subclasses representing unary functions.
Added a function derivateUnaryFunction to Derivative, to factor (f°g)' -> g' * f'°g.
Change-Id: Id1780f1082ccd001f1282fe4ddfff2b7055d3a27
Derivation now propagates to powers as expected, whether the base, the exponent, or both are functions of the variable. This also makes division derive as intended.
Change-Id: I51cbd5f7ec9f6aaa1df068625bbda1437941fa08
Derivation propagates as expected on multiplications (but not power). Some tests involving diff had to be updated to reflect that behaviour.
Change-Id: Ifa32031bc37a156c18d296757bcdd6ccdb0ea43e
Number's subclasses, with the exception of Undefined and Unreal, derive as zero. Symbols derive as expected. Derivation propagates as expected on additions.
Change-Id: Icedbb1dfac8099347a19c14bf2537011b2e8b199
This method is to be implemented by derivable expression subclasses, for use in Derivative::shallowReduce. It performs the calculation for the derivative, and returns whether calculations happened.
Change-Id: I13cdb131e2044578392f5178a9f389314c1c4c8a