Commit Graph

57 Commits

Author SHA1 Message Date
Gabriel Ozouf
891366c51d [poincare/expression_node] Added Double type
Float<float> and Float<double> used to share the same expression type
(Float), and the distinction was made by comparing their size. However,
due to padding, their size could be the same, leading to some issues :
  - On the simulator, in Calculation, type 1_mm^3 and go to the
    additional outputs. One of the results would be -0.0003081979_µm^3.

Change-Id: Ic8f9328bf462104776fbab636c34d0d152cd7e58
2020-11-04 15:07:20 +01:00
Léa Saviot
9988447b9a [poincare] Expression::isIdenticalToWithoutParentheses 2020-04-15 09:16:32 -04:00
Émilie Feral
4d593a6149 [poincare] PrintFloat: take into account the distinction between char
and glyph length in ConvertFloatToText
2019-09-26 11:26:48 +02:00
Émilie Feral
36648ee0d8 [poincare] PrintFloat: change name "k_maxFloatBufferLength" -->
"k_maxFloatBufferSize"
2019-08-09 12:04:33 +02:00
Léa Saviot
b0b10f184e [poincare/print_float] convertFloatToText -> ConvertFloatToText 2019-08-08 17:22:06 +02:00
Léa Saviot
61cf762eef [poincare] Expression::ReductionContext 2019-08-08 16:29:37 +02:00
Émilie Feral
24c9617a89 [poincare] Templatize TreeHandle Builders 2019-02-21 11:29:35 +01:00
Émilie Feral
7b5f3c570d [poincare] Change the way Expression are built 2019-02-21 11:29:35 +01:00
Léa Saviot
0bf3e678d9 [poincare] Add tests and asserts about sign, such as sign(0)==0 2019-01-21 11:22:55 +01:00
Émilie Feral
ad8f0a73d9 [poincare] Fix Addition::shallowBeautify
B+A should be beautified in A+B
1+x should be beautified in x+1
2019-01-10 11:42:04 +01:00
Émilie Feral
26e2e9be0d [poincare] Add complex format as an argument of simplification 2019-01-10 11:42:04 +01:00
Émilie Feral
38de794642 [poincare] Change signature setSign(Context, AngleUnit, ReductionTarget) 2019-01-10 11:42:03 +01:00
Émilie Feral
9e2b709fcb [poincare] Change sign() signature to sign(context, angleUnit) 2019-01-10 11:42:03 +01:00
Émilie Feral
fe6a5af47b [poincare] Change Expression::setSign signature 2019-01-10 11:42:03 +01:00
Émilie Feral
c02691a84b [poincare] Float can be serialize 2018-09-18 18:22:02 +02:00
Léa Saviot
9b5f90d5bc [poincare] Uninline Float constructor 2018-09-10 09:40:57 +02:00
Léa Saviot
e3a09286ac [poincare] Remove AllocationFailures 2018-09-05 16:19:11 +02:00
Léa Saviot
d9198c9f39 [poincare] Update Float and Floor 2018-08-31 16:29:11 +02:00
Léa Saviot
6b7fce949e [poincare] setSign is not const anymore 2018-08-31 11:20:06 +02:00
Léa Saviot
d3d969021a [poincare] Implement class Float 2018-08-17 17:18:26 +02:00
Émilie Feral
5fd415eb9e [poincare] Register Static Allocation Failure if required 2018-08-09 17:16:22 +02:00
Romain Goyet
67426410a6 [poincare] WIP for Division and Float fix 2018-08-08 16:21:39 +02:00
Émilie Feral
676bd46f33 [poincare] Expand numbers to complex numbers
Change-Id: I2e7cf5240e184da45b656ee4f121ad76aabfd1c7
2017-02-13 17:15:03 +01:00
Émilie Feral
42e4cf408d [poincare] Enbale to evaluate expression in degrees or radian
Change-Id: I8b08e7fa93431817559a594a1ea03d4414f0c830
2017-02-06 16:30:48 +01:00
Émilie Feral
8d30d3fd0a [poincare] Specify display mode in write text in buffer
Change-Id: I4033aad1581d9b12876a136a6719d935fe83e361
2017-02-06 16:30:47 +01:00
Émilie Feral
e951140298 [poincare] Change method createLayout() to createLayout(DisplayMode)
Change-Id: Ifb1027d38b53a50a0ada80e11b68d44e72ac9099
2017-01-31 10:36:13 +01:00
Émilie Feral
7f658266c3 [poincare] [apps] Merge Display mode enum class of Float and Preferences
Change-Id: I50498ff0f12991fdd905421441eee7a477d53a4d
2017-01-30 16:11:36 +01:00
Émilie Feral
7f88042104 [poincare] Fix bug: enable to parse -0.2 (due to -0 == 0)
Change-Id: I66fbc17582080ccb56205e3b3b5cad47b17747cf
2017-01-15 20:04:59 +01:00
Émilie Feral
a74eef903a [poincare] Redesign Float::convertTotext
Change-Id: Id27d9472147b5e443ee296feca891392fad735c8
2017-01-15 20:04:59 +01:00
Émilie Feral
fb624b1fba [poincare] Reimplement float parsing (handling non null char *)
Change-Id: Iff18fb586faa73125cd87c63667cd3458196fcfe
2017-01-15 20:04:58 +01:00
Émilie Feral
6cd85b550f [poincare] In float, for numbers that are too big or too small to use decimal mode, decrease the
number of digits in mantissa when displayed in scientific mode to use a
comparable space

Change-Id: I280bf0eb962e5653db16ed72c4499dd833905eab
2017-01-09 15:08:54 +01:00
Émilie Feral
e90f20b5bf [poincare] implement method to print float in decimal mode
Change-Id: Ibe7962a3a9d57dcfb7f2bae439dd023619d76ccc
2017-01-09 15:08:54 +01:00
Émilie Feral
3eb5a4f098 [poincare] Enable to parse float as 0.001 or 1.001
Change-Id: Ice1fbc1236fb4881997ed97f3f2eb774f2f73769
2017-01-09 15:08:54 +01:00
Émilie Feral
62b838e3d1 [poincare] Correct float to string method to agree with the parsing
Change-Id: I6f32b883047f9ff06d28bc82d30e0c55acc97b2e
2017-01-09 15:08:54 +01:00
Romain Goyet
47b16a06dc [poincare] Parse floats
Change-Id: I3cfc063e1059d3769e1038593e90e6f56c0d7ce1
2016-12-21 10:13:28 +01:00
Émilie Feral
69e381d736 [poincare] Redesign the text method of expression to avoid keeping a
buffer in all expressions

Change-Id: I2ca33be09a525adf429854e651beaa75e5605d7a
2016-12-09 11:01:43 +01:00
Émilie Feral
a07a59efe9 [poincare] Factorise the method evaluate
Change-Id: Ief252568e8d232fc4606e8c86b5e3f9b4c076955
2016-12-09 11:01:39 +01:00
Émilie Feral
357f971120 [poincare] Change name: createEvaluation -> evaluate
Change-Id: I8f241541af0435c6ab4f7ba1f561f880c4e95ac0
2016-12-08 17:10:36 +01:00
Émilie Feral
0448278e36 [calculation] Make the results of calculation expressions
Change-Id: I9eb685b21944cfc6cc346a42d442f064ae5938dd
2016-12-08 15:21:52 +01:00
Émilie Feral
713a41cffe [poincare] Method to find text from a terminal expression (float or
matrice)

Change-Id: Id80e63f0e5596c4a6b98513e783ac1918ae55344
2016-12-08 15:21:52 +01:00
Émilie Feral
0ce0995e0c [poincare] add a method createEvaluation in all expressions
Change-Id: I72e78afcae2a931376108859a5615c227d364d74
2016-12-08 15:21:52 +01:00
Émilie Feral
f4b73de940 [poincare] define the float create layout method
Change-Id: I9d01272e450cf300ae3a0c8dd2541507cfbcb7a2
2016-12-08 15:21:52 +01:00
Émilie Feral
4967681a80 [poincare] delete useless destructor in float
Change-Id: I019e3ad31e49fabcacdcd77518dbf905328ec0a0
2016-11-23 14:29:52 +01:00
Émilie Feral
2eae7c43ff [poincare] Handle inf and nan when convert float in string
Change-Id: I2121a8030d044984235e48ad50a3c6ec9e06c31e
2016-10-26 16:26:47 +02:00
Émilie Feral
0dffa59352 [poincare] Use roundf to turn float in string
Change-Id: I4414cc66c004c5abab12c36d945c63d2df8f70ea
2016-10-26 16:26:47 +02:00
Émilie Feral
816a9587d6 [poincare] Round the float instead of truncate it when turned into a
string

Change-Id: Ia7c36cbf51b6fee17e25eb186548aa55ab115ea8
2016-10-24 10:31:15 +02:00
Émilie Feral
bac174ebfc [poincare] In float, add method to convert float to text
Change-Id: I9a85c02e0b2843ee999847b821b9d24f1452eb5d
2016-10-14 12:06:00 +02:00
Felix Raimundo
77f057de82 Add the const qualifier to Expression methods
Change-Id: Ic05828a91c89cb391e6d7c1d4a5220fad4aea5e7
2016-04-18 18:48:56 +02:00
Felix Raimundo
2f7b1f4860 Add the cloneWithNewOperands method.
This allows to replace the operands of an expression with new ones.

Change-Id: I3c2d183bbdbcc43b776f7ce2a302216c52e494bd
2016-04-11 12:21:14 +02:00
Romain Goyet
de2f83e8bd Poincare: Put the AST printing in its own file
Change-Id: I1793fa2057098f31a549faf6bf39e64c333b5b06
2016-04-01 15:02:31 +02:00