Commit Graph

173 Commits

Author SHA1 Message Date
Léa Saviot
c4908c2bd9 [apps/calculation] Fix bottom calculation margin
Scenario: enter a calculation that uses two lines, the margin on the
bottom is too big
2020-05-28 04:44:27 -07:00
Léa Saviot
5535145b51 [apps/calculation] Calculation on 2 lines if does not fit when expanded
Scenario: 1+1+1+1+1+1+1+10.5 fits on one line when not expanded, but
when the exact result is displayed not -> we thus always display it on
two lines
2020-05-28 04:44:27 -07:00
Léa Saviot
579485c8c0 [apps/calculation] CanBeSingleLine differs if args are view/layout sizes
If the sizes are for layouts, we need to add the margins added by the
views.
2020-05-28 04:44:27 -07:00
Léa Saviot
4f50a72abf [apps/calculation] Clean Calculation::height 2020-05-28 04:44:27 -07:00
Léa Saviot
11c39b6206 [apps/calculation] Calculation::height has two types of margin arguments
One for the margin between layouts and on top / at the bottom of the
cell, the other for the margin surrounding each layout.
2020-05-28 04:44:27 -07:00
Léa Saviot
78cac6ddae [apps/calculation] Calculation::height has CanBeSingleLine argument 2020-05-28 04:44:27 -07:00
Léa Saviot
525290427a [apps/calculation] Calculation::height takes verticalMargin argument 2020-05-28 04:44:27 -07:00
Léa Saviot
7ccaf3fc50 [apps/calculation] Rename allExpressionsInline to forceSingleLine 2020-05-28 04:44:27 -07:00
Léa Saviot
5a68b44aa1 [apps/calc] Merge SingleLine and allExpressionsInline behaviours 2020-05-28 04:44:27 -07:00
Léa Saviot
c3d8520e73 [apps/calculation] Remove unnecessary bool 2020-05-28 04:44:27 -07:00
0b101
b48d3d6e4a Added a new compact result display mode 2020-05-28 04:44:27 -07:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Émilie Feral
c3d8e09ceb [apps/calculation] Calculation: invalid heights memoization when forcing the
display output
2020-02-20 10:56:11 +01:00
Émilie Feral
e17ae9024e [apps] Gather all code regarding exam mode in ExamModeCOnfiguration file 2020-02-12 15:13:26 +01:00
Ruben Dashyan
81d755927c [apps/calculation/calculation] Fix array length computation 2020-02-12 15:13:25 +01:00
Ruben Dashyan
2ae435a628 [apps/calculation/calculation] Remove redundancy
When each Calculation had its own text buffer, the Expression of an
overflowing output text was Undefined. Hence that Expression could have
been Undefined without the corresponding text being 'undef'. That situation
may not happen anymore since Calculation are stored in a shared buffer.
2020-02-12 15:13:24 +01:00
Ruben Dashyan
1393e5e973 [apps/calculation/calculation] Rearrange the conditions forcing DisplayOutput::ApproximateOnly 2020-02-12 15:13:24 +01:00
Ruben Dashyan
46a5a7cf5c [apps/calculation/calculation] Force DisplayOutput::ApproximateOnly when there is Unit
The most common case where only the approximate output is displayed
happens when the exact and the approximate outputs are equal, more
precisely when the exact output is equal to the approximate output with
the number of significant digits taken from user settings. That
clarification matters for the Poincare::Integers which have more digits than
the number of significant digits set by the user.

Besides, an Expression containing Units is simplified as
Multiplication(Float, Unit...) recorded identically into the exact and
the approximate outputs (except perhaps the number of significant
digits). Generally, the case where the number of digits in the output is
smaller or equal to the user setting would be matched by the condition,
stated above, that exact and approximate output are equal. But that
should also be the case whatever the number of significant digits. That
is why the presence of Units is matched specifically.
2020-02-12 15:13:24 +01:00
Émilie Feral
551e4998f4 [apps/calculation][apps/solver][poincare] Simplify sign =/≈ computation
between outputs in Calculation/Solver
2020-02-12 15:13:23 +01:00
Émilie Feral
c2540a1d8a [apps/calculation] Calculations now hold 4 texts: input, exact output
and 2 approximate outputs - one with the maximal number of significant
digits and one with the number of significant digits asked by the user.
This enables to find the approximate output without going through the
approximation routine again.
2020-02-12 15:13:23 +01:00
Ruben Dashyan
c4f112e5aa [apps/calculation/calculation] Do not approximate approximateOutput again 2020-02-12 15:13:23 +01:00
Émilie Feral
c629cb66ba [apps/calculation] Calculation: don't memoize the display in height
computation. It has to be updated everytime an exception is raised and
this was forgotten.
2020-02-12 15:13:22 +01:00
Émilie Feral
0c19b54365 [apps/calculation] Do not display additional results for Equal or Store
expressions
2020-02-12 15:13:22 +01:00
Émilie Feral
8d7eebbf0e [apps/calculation] Calculation: fix variable confusion 2020-02-12 15:13:21 +01:00
Léa Saviot
756eeeb2d8 [poincare/parser] Add context 2020-02-12 15:13:21 +01:00
Émilie Feral
ba159de21d [apps/calculation] Trigonometry additional results are displayed if the
input OR the output is a cosine/sine
2020-02-12 15:13:21 +01:00
Émilie Feral
398b529811 [apps/calculation][poincare] AdditionalInformationType is determined
from both input and output expressions of a Calculation
2020-02-12 15:13:21 +01:00
Léa Saviot
97c5ef79af [apps/calc] Display ApproximateOnly if approximate layout cannot be created 2020-02-12 15:13:21 +01:00
Léa Saviot
1af28d4310 [apps/calc] Display ApproximateOnly if exact layout cannot be created 2020-02-12 15:13:21 +01:00
Émilie Feral
715a1a2d5e [calculation] AdditionalInformation are base on the Calculation input
instead of exact output
2020-02-12 15:13:19 +01:00
Émilie Feral
157aa206c6 [calculation] Calculation: add a parameter to height to compute the
height of the calculation cell with all expressions inlined
2020-02-12 15:13:19 +01:00
Émilie Feral
a21689d72c [apps/calculation][poincare] Move additionalInformationType method from
Calculation to Poincare module
2020-02-12 15:13:18 +01:00
Émilie Feral
66b88de4b4 [apps/calculation] WIP: Improve Calculation::additionalOuput 2020-02-12 15:13:18 +01:00
Émilie Feral
f0ec2136b7 [apps/calculation] WIP: display the complex graph when clicking on the
burger menu
2020-02-12 15:13:18 +01:00
Émilie Feral
fa5902dcd2 [apps/calculation] Calculation: add a methods additionalOuput 2020-02-12 15:13:18 +01:00
Émilie Feral
5491dee5ce [calculation][solver] Do not display exact solutions in Dutch exam mode 2019-12-19 15:52:45 +01:00
Émilie Feral
221b4af631 [apps/calculation] Fix warning: taking address of a packed member is
unsafe
2019-09-04 15:36:37 +02:00
Léa Saviot
3849aba0c2 [apps/calculation] Don't display exact result for parametered expr
Otherwise symbolic computation is possible with, for instance :
diff(x+x,x,2)
    diff(2x,x,2) = 2
2019-08-27 17:21:48 +02:00
Léa Saviot
7e397ac92b [apps/calculation] Clean code 2019-08-27 17:21:01 +02:00
Léa Saviot
48971b6eb3 [apps/calculation] Display approx only if input = exactOutput 2019-08-27 11:09:16 +02:00
Léa Saviot
c980f8bf7c [apps/calc] Bigger serialization buffer to fix glitch
Otherwise, identity(15) displays both exact and approximate outputs,
because the approximation serialization does not fit in the buffer.
2019-08-22 10:33:40 +02:00
Émilie Feral
42bb1440e3 [apps/calculation] Inputs involving 'frac' display only the approximate
output
2019-08-20 11:51:37 +02:00
Émilie Feral
1cc09de9ae [apps/calculation] Invalid calculation height memoization when leaving
the app.

Fix wrong memoization: in calculation app input '[[1+i, 2][3,4]]', change
the complex format to Polar, go back to the calculation app --> the
calculation height was no recomputed despite the fact that the approximation
output changed.
2019-08-19 09:59:01 +02:00
Léa Saviot
4bbb8167f1 [poincare/matrix_inverse] Handle memory error in MatrixInverse 2019-08-08 17:22:04 +02:00
Léa Saviot
76a950d572 [apps/calculation] Add assertions instead of escape cases 2019-08-08 17:22:03 +02:00
Léa Saviot
f5e11b7d74 [apps/calculation] Exception checkpoint around secondary method
When computing [[2,3,2][ln(2),1,5][1,8,9]] there was a memory pool
failure because of the computation of
exactAndApproximateDisplayedOutputsAreEqual. Because displaying the
right equal symbol is less important than displaying a result, we
encapsulate the method in an exception checkpoint: if there was not
enough memory on the pool to compute the equal sign, just return
EqualSign::Approximation.
2019-08-08 17:22:03 +02:00
Léa Saviot
c7fd11e4b0 [apps/calculation] Calculation store has one big buffer for calculations 2019-08-08 17:22:02 +02:00
Léa Saviot
1642df476a [apps/calculation] Don't display exact result for condifence/prediction 2019-08-08 16:29:38 +02:00
Léa Saviot
e5e9f0bf78 [apps/calculation] Fix Calculation::displayOutput
Should return ApproximateOnly if the exactOutput expression is Undefined
2019-08-08 16:29:38 +02:00
Léa Saviot
168e0b492f [apps/calculation] Don't display approximate matrices results only 2019-08-08 16:29:38 +02:00