In UnitConvert::shallowBeautify, an orphan expression would be reduced
without reaffecting the reduction's result. The reduction not being
taken into account would cause problem when handling undef values.
ex : Try to calculate i->_min
Change-Id: I4e53afa40ba838fed8c2fba9944c9c9ed1dc95b4
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
The new zoom implemented for ContinuousFunction is now factorized inside
Function to benefit the Sequence class. The same things is done to code
added to Graph::GraphController, which is moved into
FunctionGraphController.
This removes the reimplementation of several methods, most notably
computeYRange, as the implementation for function is general enough to
work on sequences.
Change-Id: I9b8211354064f46c3fa3dde3191dcb39d627a1d2
The auto zoom did not display the X axis when drawing positive curves
with roots, such as sqrt(x).
Change-Id: Ic80fd3207691dc917f7b64c07d7745ab5df1daa3
Additional checks have been added to ensure that the first move of the
cursor from the center of the graph would not cause the window to pan up
or down.
Change-Id: I44d7e86223941076cbf03db7a221e9c0427a64e4
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
Initial zoom for displaying curves is computed according to the
following rules :
- For polar and parametric curves, the algorithm has not changed.
Vertical and horizontal ranges are chosen in order to display the
full curve with orthonormal graduations.
- For cartesian curves, the horizontal range is chosen in order to
display all points of interest (roots, extrema, asymptotes...).
The vertical range is fitted to be able to display those points, but
also cuts out points outside of the function's order of magnitude.
Change-Id: Idf8233fc2e6586b85d34c4da152c83e75513d85c
In Graph, the weak ReductionTarget would cause _X^0 to not be simplified
to 1, and would break an assertion in
Unit::chooseBestRepresentativeAndPrefix.
Change-Id: I8167a472802baf0a73bf48513f492e78517107ef
Pressing OK or EXE with the brightness setting selected would cause a
crash because of a mishandling of the events for this cell.
Change-Id: I4978b4f749b5f19bc1e49ec05b60a32044d86638
When factoring 1^inf * 1^-inf with Multiplication::factorizeBase, an
Undef factor would appear an be carried into the reduced multiplication.
We escape early in this situation by returning Undef.
Change-Id: Id826ad3cc131349e5bb460f7a8c82fe606294b97
The addSibling method sometimes did not take into account the offset
introduced by adding parentheses, leading to some issues :
- Type 2 SQUARE RIGHTPARENTHESIS LEFT SQUARE. Parentheses are added
but the new square should be outside, between the two right
parentheses.
Change-Id: Ifbc49cee2cd03c4511fc5a678d6d5d42243f4a22
When typing Square in 2D Edition mode, the cursor would not be
repositionned correctly, leading to some issues :
- Typing 2 POW 3, pressing RIGHT to return to the baseline, then
typing POW again adds parentheses around 2^3, as is mathematically
correct. Typing 2 SQUARE, then POW, would show 2^2^_, while
the user really typed (2^2)^_.
Change-Id: I29c01d964924907a1866490189ea56e40771521d
poincareCircuitBreaker requires the Back key to be pressed for at least
50 ms before interrupting a computation.
This is effectively invisible for the user, but fixes a bug in
Calculation :
- When leaving the additional results for a result using units by
pressing the Back key, a reduction preceding a call to removeUnits
would be interrupted, causing an undefined behaviour.
Change-Id: Iec667ae964f190de2171850cc22e1726959e6cb5
After choosing a language at onboarding, the country menu now has a
specific country selected by default (Spain for Spanish, Italy for
Italian...)
Default countries are specified in apps/language_preferences.csv
Change-Id: Ia6392aceb9bebf7e62a692c5a79eb8c4d7b71a9d
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
The symbol for pint (_pt) conflicts with the symbol for pico-tonne. To
solve that, prefixes for tonnes are now restricted to the positive
prefixes : k, M, G, T.
Change-Id: Ie968374bbb5e0ebd2c0f08e4b1bdc1708eb6a041
Instead of relying on the order in which the apps are passed at compile
time, the look of the Home app is defined in a config file, and depends
on the country chosen.
Change-Id: If7f56a284e0001d6d75ece1e7efdf5fd1d0a9978
The additional results on units now include conversions into both unit
systems (metric and imperial).
Change-Id: Ie0f12eb3735e775560b66c2cbd78bc9a659145bb
Added methods to return the standard format for each dimension,
depending on the chosen unit system.
Change-Id: I3591a806beca315674cc09093b57e8753db5db6a
A split (such as _h+_min+_s) can now be generated for distances, volumes
and masses using imperial units.
Change-Id: Ib3ad63614979eddd02fbe0e99f16cf09dcf7c1fc
BuildTimesplit (used to create expressions of the form h+min+s) is now
based on the more general BuildSplit.
Change-Id: I3e55359cc6b9735269140942b29bd1d364fc35e7
When the country is USA, the units will be simplified to common imperial
units rather than metric.
Change-Id: Ia533527a429ac26526380e324b9543b359f3b400
Classes LanguageController and CountryController have been fused into
one class LocalizationController, as they were very similar. This allows
the Settings and OnBoarding apps to only keep one controller for both
functions.
Change-Id: Ic23f300c37122249d34caaf18a633b5815240a78
Instead of being hardcoded in the python script, preferences specific to
each country are defined in the country_preferences.h and .csv files.
Change-Id: I71e276341e1586935b4d5814be5b1be80fa170a0
Each country comes with an set of preferences, built at compile time by
apps/i18n.py, used to define :
- the exam mode
- the method for computing quartiles
- the unit system in which to output the results with units
Functions to access those preferences are available in
via sharedGlobalPreferences.
Change-Id: I220ebaa9b9e8954dfe33cd51936f47505b98978d
The new units are :
distance mile, yard, foot, inch
mass pound, ounce
volume gallon, quart, pint, cup, fluid ounce
table spoon, tea spoon
Change-Id: I6864067a1822a077764ed3b61fc46004732e9447
As some definitions now depend on the selected country, tests for the
statistics app now check that the right method is used for each country,
and that each method yields the correct results.
Change-Id: Ia5ad091136746f3284f7524376301fac0c582364
Implemented a new method for computing quartiles, used for all countries
except France and Italy. Quartiles are now computed as the medians of
the lower half and upper half of the dataset.
Change-Id: Idfb89a617799eca1d23326ebbcfbbea58e6236b8