Émilie Feral
a211b6efb6
[poincare] Change unit name: hour -> h
2020-02-12 15:13:25 +01:00
Ruben Dashyan
ca50e764a5
[poincare/test] Test the presence of units as Expression children
2020-02-12 15:13:25 +01:00
Ruben Dashyan
e39ad9d923
[poincare/expression_node] Fix ExpresssionNode::Type ordering
...
A Multiplication whose children are all real or ComplexCartesian are
multiplied to form a single ComplexCartesian. That step of shallowReduce
assumed that the last child is a ComplexCartesian. Since a Unit is now
considered as real, the previous assumption can be maintained be
reordering the ExpresssionNode::Type.
2020-02-12 15:13:25 +01:00
Ruben Dashyan
4a6b633c74
[poincare] Fix commit "Reducing an Expression which hasUnit in its children returns Undefined in general"
2020-02-12 15:13:25 +01:00
Léa Saviot
c124447837
[poincare/test] Add test on UnitConvert simplification
2020-02-12 15:13:25 +01:00
Léa Saviot
b2a37cfd3e
[poincare] Fix tests
2020-02-12 15:13:25 +01:00
Léa Saviot
94d71634b6
[poincare/unit_convert] In shallowReduce, fix units testing on the right
...
First reduce the right member by replacing the units to make sure there
is a unit, then reduce without replacing to keep "complex units" such as
L, N, ...
2020-02-12 15:13:25 +01:00
Léa Saviot
1e3294139d
[poincare/parser] 0→0→c should not be parsable
2020-02-12 15:13:25 +01:00
Ruben Dashyan
681ab5429a
[poincare/test/simplification] Fix typos
2020-02-12 15:13:25 +01:00
Ruben Dashyan
81d755927c
[apps/calculation/calculation] Fix array length computation
2020-02-12 15:13:25 +01:00
Ruben Dashyan
b5233845ba
[poincare/expression] Fix Unit approximation in beautifyAndApproximateScalar
...
A Unit is considered as real, which was not the case before.
2020-02-12 15:13:25 +01:00
Léa Saviot
2e5df5196f
[poincare/expression] hasUnits makes less computations
2020-02-12 15:13:25 +01:00
Léa Saviot
23e8033a3e
[poincare/test] Add tests on unit convert simplification
2020-02-12 15:13:25 +01:00
Léa Saviot
1588f81bea
[poincare/power] Fix shallowReduce with units
...
(3_m^2)^3 should be reduced to 3_m^6
2020-02-12 15:13:25 +01:00
Léa Saviot
308ffb3e3c
[poincare/test] Add tests on getUnit
2020-02-12 15:13:25 +01:00
Ruben Dashyan
cc280373d0
[poincare] Reducing an Expression which hasUnit in its children returns Undefined in general
2020-02-12 15:13:25 +01:00
Ruben Dashyan
f465637c86
[poincare/complex_cartesian] Add defaultShallowReduce
2020-02-12 15:13:25 +01:00
Ruben Dashyan
2d5708c782
[poincare] Remove dummy defaultShallowReduce
...
Decimal and BasedInteger have no children
2020-02-12 15:13:25 +01:00
Léa Saviot
e4601206be
[poincare/power] Fix getUnit -> return Undef if base has undef unit
2020-02-12 15:13:25 +01:00
Léa Saviot
2527f30429
[poincare] Beware of units in "difficult" shallowReduces - Power
2020-02-12 15:13:25 +01:00
Léa Saviot
e1a7dcdb13
[poincare] Beware of units in "difficult" shallowReduces - Addition
2020-02-12 15:13:25 +01:00
Léa Saviot
b93277bb7b
[poincare/test] Fix tests
...
Unparsable tests are now parsable but return undef at the simplification
2020-02-12 15:13:25 +01:00
Léa Saviot
d5b07f1f90
[poincare] Implemment getUnit
2020-02-12 15:13:25 +01:00
Léa Saviot
94334169f0
[poincare/expr] Remove beautifiedExpHasUnits and reducedExpIsUnitsOnly
2020-02-12 15:13:25 +01:00
Léa Saviot
ecdcb100fb
[poincare/unit_convert] Fix UnitConvert::shallowReduce
2020-02-12 15:13:25 +01:00
Léa Saviot
d98eddf960
[poincare/parser] UnitConvert does not check the right member is a unit
2020-02-12 15:13:25 +01:00
Émilie Feral
9dbb1153a1
[escher] Add TODOs on EditableField, InputEventHandler, LayoutField,
...
TextInput, TextArea, TextInput
2020-02-12 15:13:25 +01:00
Émilie Feral
9c25fdb66e
[escher] TextField: fix shouldFinishEditing to reset selection
2020-02-12 15:13:25 +01:00
Émilie Feral
2470821a6b
[apps/settings] Fix sub controller viewWillAppear /
...
didEnterResponderChain behaviours
This fixes the following bug: when editing the number of significant
digits, input "1+", click on "OK", the data was reloaded and "1+"
disappeared...
2020-02-12 15:13:25 +01:00
Émilie Feral
4e6411e4a5
[poincare] Unit: missing include for device build
2020-02-12 15:13:25 +01:00
Ruben Dashyan
3aea607be2
[poincare] Force Float(1) in front of an orphan (Power of) Unit
2020-02-12 15:13:25 +01:00
Ruben Dashyan
d8e36e3cf1
[poincare/test/simplification] Fix units' tests
2020-02-12 15:13:25 +01:00
Ruben Dashyan
907bd0db62
[poincare/test/simplification] Fix typo
2020-02-12 15:13:25 +01:00
Ruben Dashyan
30fb27d36a
[poincare/test/simplification] Add tests on Units
2020-02-12 15:13:25 +01:00
Léa Saviot
16a832507e
[emscripten/whitelist] Whitelist some methods
2020-02-12 15:13:25 +01:00
Émilie Feral
533f1312db
[solver] Add test with 6 variables
2020-02-12 15:13:25 +01:00
Émilie Feral
3df80ed780
[poincare] ParameteredExpression: overrides getVariables to avoid
...
considering parameter as a variable
2020-02-12 15:13:25 +01:00
Léa Saviot
b8f65442db
[ion/simulator] Keyboard shift + left/right/up/down now works
2020-02-12 15:13:25 +01:00
Émilie Feral
5cb26b19a5
[poincare] Parsing: Unit token does not accept '_' char except at first
...
position. This enables to parse "_km_s" as Multiplication(Unit(km),
Unit(s))
2020-02-12 15:13:25 +01:00
Émilie Feral
f91ca59ca3
[poincare] Test: call Expression::Parse instead of creating a parser
...
object everytime we need to parse something
2020-02-12 15:13:24 +01:00
Léa Saviot
5afb49c85d
[poincare] Rename RightArrow -> RightwardsArrow
2020-02-12 15:13:24 +01:00
Léa Saviot
83ea9cf1e1
[poincare/parser] Rename Store with RightwardsArrow
2020-02-12 15:13:24 +01:00
Léa Saviot
7a65e5180b
[poincare/right_arrow_expression] Factorize Store and UnivtConvert
2020-02-12 15:13:24 +01:00
Léa Saviot
8a0e5403ae
[poincare/test] Add unit conversion tests
2020-02-12 15:13:24 +01:00
Ruben Dashyan
657ae5ff63
[poincare/unit] Fix shallowBeautify
...
Expressions with Units inside an Opposite were beautifed as Undefined
2020-02-12 15:13:24 +01:00
Ruben Dashyan
22e22b8123
[poincare/tree_handle] Make sure B has the same parent as A after A.replaceWithInPlace(B)
...
Even when A has no parent, B should be detached from its old parent.
2020-02-12 15:13:24 +01:00
Léa Saviot
4651f7ef0d
[poincare/expression] Fix simplifyAndApproximate with convertUnit
2020-02-12 15:13:24 +01:00
Émilie Feral
1484dbc5d4
[poincare] Multiplication::shallowReduce: simplify implementation!
...
(recursivelyMatches all children is equivalent to recursivelyMatches on
the current node)
2020-02-12 15:13:24 +01:00
Émilie Feral
ff438cbea8
[poincare] Multiplication::shallowReduce: don't apply 0*a --> 0 when a
...
involves unit or infinity
2020-02-12 15:13:24 +01:00
Émilie Feral
ee1224dd95
[poincare] Multiplication::shallowBeautify: Keep the unit when the value
...
is 0 or undefined, add tests
2020-02-12 15:13:24 +01:00