#include <Number.h>
Inheritance diagram for mcNumberHelpers:
This is entirely defined & implemented through macros.
Definition at line 63 of file Number.h.
Public Member Functions | |
mcNumberHelpers () | |
virtual | ~mcNumberHelpers () |
void | data_DeepCopy (const mcElementHelpers *p) |
Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in p or deep-copying it otherwise. | |
bool | data_isSameAs (const mcElementHelpers *p) const |
Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object. | |
bool | data_isAllowedBefore (mcElementType type) const |
Returns TRUE if this element is allowed to be directly on the left of the given element type. | |
bool | data_isAllowedAfter (mcElementType type) const |
Returns TRUE if this element is allows to be placed directly on the right of the given element type. | |
void | data_Set (const mcRealValue &d) |
mcRealValue | data_Get () const |
void | gui_Set (const wxString &toset) |
wxString | gui_GetStr () const |
void | math_Abs () |
bool | math_isValid () const |
bool | math_GetNumDen (mcIntegerValue &num, mcIntegerValue &den) |
mcFraction | math_TransformInFraction () |
void | math_RaiseBaseTo (mcRealValue n) |
virtual void | math_RaiseTo (const mcIntegerValue &n) |
bool | io_isBeginTag (const wxXml2Node &tag) const |
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. | |
bool | io_isBeginChar (const wxString &str) const |
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. | |
wxXml2Node | io_GetBaseMathML (bool bGetPresentation) const |
Returns a MathML tree with the presentation math markup language regarding the base. | |
wxString | io_GetBaseInlinedExpr () const |
bool | io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr) |
Imports presentation MathML reading the contents of the given XML node (without modifying it). | |
bool | io_ImportBaseInlinedExpr (const wxString &, int *count, wxString &pErr) |
mcExpElement overloaded BASE functions | |
bool | gui_isBeginKey (const mcKey &ev) const |
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. | |
bool | gui_isBaseEndKey (const mcKey &ev) const |
This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key. | |
bool | gui_DrawAsActiveOverBase () const |
mcNumber is not a container element, thus when mouse cursor is placed over the base, all the element should be drawn as active. | |
mcInsertRes | gui_BaseInsert (const mcElement &, mcElement *) |
mcInputRes | gui_BaseInput (const mcKey &key, mcElement *pnew) |
Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function... | |
mcMoveCursorRes | gui_BaseMoveCursor (mcMoveCursorFlag flag, long modifiers) |
Handles cursor movements when the cursor is editing the base. | |
int | gui_DrawBase (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
Identical to mcElement::gui_Draw, but just for the base. | |
int | gui_BaseMoveCursorUsingPoint (wxDC &, const wxPoint &) |
Moves the cursor inside the base using the given point and, eventually the given DC for calculations. | |
int | gui_GetBaseRelCursorPos (wxDC &dc, wxPoint *pt) const |
Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base. | |
void | gui_GetBaseCursorPos (mcCursorPos &) const |
Returns one of the cursor position flags (called only when cursor is inside the base). | |
void | gui_SetBaseCursorPos (const mcCursorPos &) |
Sets the cursor position of the element. | |
void | gui_DoRecalcBaseSize () |
Calculates (in the m_szBase variable) the size of the base only. | |
void | gui_EditBase () |
Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos. | |
bool | gui_Split (mcElement *) |
mcNumber is one of the few elements which supports splitting. | |
bool | gui_MergeWith (const mcElement &) |
Merges the given element with this object. | |
bool | gui_isSplittable () const |
Returns TRUE if this element supports splitting and, thus, also merging. | |
mcExpElementMath and mcElementMath abstract functions | |
Implementation of pure virtual common math functions. | |
bool | math_CanBeAddedWith (const mcElement &p) const |
Returns TRUE if this element can be added with the given element. | |
bool | math_CanBeMultWith (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for multiplication. | |
bool | math_CanBeDivBy (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for divisions. | |
mcBasicOpRes | math_Add (const mcElement &, mcElement *, bool add) |
Sums or subtracts this element with the given e element. | |
mcBasicOpRes | math_MultiplyBaseOnlyBy (const mcElement &, mcElement *) |
mcBasicOpRes | math_DivideBaseOnlyBy (const mcElement &, mcElement *) |
mcBasicOpRes | math_MultiplyBaseBy (const mcElement &, mcElement *) |
mcBasicOpRes | math_DivideBaseBy (const mcElement &, mcElement *) |
mcRealValue | math_GetBaseLenght () const |
mcRealValue | math_EvaluateBase () const |
int | math_GetOrderPos () const |
Returns the order position for this element. | |
mcMathType | math_GetBaseMathType () const |
mcBasicOpRes | math_MakeReciprocal (mcElement *) |
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. | |
mcExpSimRes | math_ExpandBase (long flags, mcElement *newelem) |
mcExpSimRes | math_SimplifyBase (long flags, mcElement *newelem) |
mcExpSimRes | math_SimplifyBaseExp (long flags, mcElement *pnew) |
bool | math_CompareThisOnly (const mcElement &p, long flags) const |
Compares this element and the given one and then stops, unlike math_Compare() that compares children too. | |
mcMonomial | math_GetBaseLCM (const mcElement &p) const |
mcMonomial | math_GetGCD (const mcElement &p) const |
Static Public Member Functions | |
static bool | gui_isDigit (int vk) |
Returns TRUE if the given keycode is a digit (0, 1, 2, 3, 4, 5, 6, 7, 8 or 9). | |
static bool | gui_isDecimalPoint (wxChar totest) |
Returns TRUE if the given character is considered as a decimal point. | |
static bool | math_isZero (const mcElement &) |
Static Public Attributes | |
static int | sgui_nDigitToShow = -1 |
The number of digits of #m_n which will be shown when exporting through the mcNumberIO functions or when viewing the graphical representation through the mcNumberGUI functions. | |
static wxString | sgui_strFloatingPoint = wxT(".,") |
Contains the characters recognized as floating point. | |
static bool | smath_bUseIntegersWhenPossible = TRUE |
If TRUE, then fractions with integer coefficients will be used when possible, instead of decimal numbers:. | |
static mcNumber * | smath_pOne = NULL |
A mcNumber with "1.0" as content... | |
static mcNumber * | smath_pTwo = NULL |
static mcNumber * | smath_pFour = NULL |
static mcNumber * | smath_pMinusOne = NULL |
static mcNumber * | smath_pZero = NULL |
Protected Member Functions | |
void | gui_Init () |
Inits this section of the element. | |
Protected Attributes | |
mcRealValue | mdata_n |
The number represented by this class. | |
wxString | mgui_strTrailer |
mcNumberGUI allows the user to input decimal numbers (of any lenght) so it cannot just read the input through gui_BaseInput() and add the typed digits to mcNumber::data_m_n because if the user wants to add a zero when the cursor is placed in the rightmost digit after the comma, in this way it wouldn't work: | |
int | mgui_nCursorPos |
The cursor position. | |
Private Member Functions | |
mcDEFINE_REFERENCE_DATA (mcNumber, mcET_NUMBER) |
|
|
|
|
|
Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in The same checks are performed on the subscript. Reimplemented from mcExpElementHelpers. Definition at line 205 of file Number.h. References mcExpElementHelpers::data_DeepCopy(), mdata_n, and mgui_strTrailer. |
|
|
Returns TRUE if this element is allows to be placed directly on the right of the given element type. See #isAllowedBefore for more info. Reimplemented from mcElementHelpers. Definition at line 227 of file Number.h. References mcET_BRACKET, mcET_FRACTION, mcET_FUNCTION, mcET_NUMBER, mcET_RADICAL, and mcET_SYMBOL. |
|
Returns TRUE if this element is allowed to be directly on the left of the given element type. If this function returns FALSE (default implementation returns TRUE), the container element will interpose a mcMultOp between this element and the following.
Reimplemented from mcElementHelpers. Definition at line 221 of file Number.h. References mcET_NUMBER. |
|
Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object.
Reimplemented from mcElementHelpers. Definition at line 212 of file Number.h. References mdata_n. |
|
Definition at line 238 of file Number.h. Referenced by gui_MergeWith(), gui_Set(), gui_Split(), io_ImportBaseInlinedExpr(), io_ImportPresentationMathML(), math_Add(), math_DivideBaseOnlyBy(), math_MultiplyBaseBy(), math_MultiplyBaseOnlyBy(), math_RaiseBaseTo(), math_RaiseTo(), and math_SimplifyBaseExp(). |
|
Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function...
Implements mcExpElementHelpers. Definition at line 222 of file Number.cpp. References data_Get(), mcMathCore::Get(), gui_GetStr(), mcExpElementHelpers::gui_HandleSubExpEditKeys(), gui_isDecimalPoint(), gui_isDigit(), mcElementHelpers::gui_RecalcSize(), gui_Set(), mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, mcIR_DELETE_THIS, mcIR_OKAY, mcNUMBER_DECIMAL_POINT, mgui_nCursorPos, mgui_strTrailer, and mcMathCore::SyntaxError(). |
|
Implements mcExpElementHelpers. Definition at line 306 of file Number.cpp. References mcINSR_OKAY. |
|
Handles cursor movements when the cursor is editing the base. This function should work ABSOLUTELY without care about the exponent or subscript presence or absence: if the cursor is placed on the rightmost point of the base, and the function is called with the mcMCF_RIGHT flag, then the function should return mcMCR_SETFOCUS_NEXT without any check: the mcExpElement::gui_MoveCursor function will check the return value of this function and will corerctly handle it !!! Implements mcExpElementHelpers. Definition at line 363 of file Number.cpp. References data_Get(), mcRealValue::GetNumOfDigits(), mcMCF_DOWN, mcMCF_LEFT, mcMCF_RIGHT, mcMCF_UP, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, mcMCR_SETFOCUS_PREVIOUS, and mgui_nCursorPos. |
|
Moves the cursor inside the base using the given point and, eventually the given DC for calculations.
Implements mcExpElementHelpers. Definition at line 415 of file Number.cpp. References data_Get(), mcRealValue::GetNumOfDigits(), mcElementHelpers::gui_GetHeightOfChar(), mcElementHelpers::gui_GetWidthOfChar(), mcASSERT, mcMCR_OKAY, and mgui_nCursorPos. |
|
Calculates (in the m_szBase variable) the size of the base only. It's very important not to modify the m_sz variable: m_sz is handled by mcExpElement functions: the base must modify ONLY *m_szBase*. Implements mcExpElementHelpers. Definition at line 154 of file Number.cpp. References mcElementHelpers::gui_GetSizeOf(), gui_GetStr(), and mcElementHelpers::gui_SelectStyle(). |
|
mcNumber is not a container element, thus when mouse cursor is placed over the base, all the element should be drawn as active.
Implements mcExpElementHelpers. |
|
Identical to mcElement::gui_Draw, but just for the base. You have to draw it at the given point (x,y) without take care of the exp/sub, just do everything as they wouldn't exist. The given pointer to a wxPoint class can be mcDRW_NONACTIVE or a valid pointer value (in this case, the cursor is always inside the base). You can be sure that it will never be mcDRW_ALLACTIVE: this flag is completely handled by mcExpElement. If all the base must be drawn as active, the subscript should be too... you can use the #GetBaseAndSubSize function to make the task easier.
Implements mcExpElementHelpers. Definition at line 164 of file Number.cpp. References mcElementHelpers::data_GetID(), mcExpElementHelpers::gui_GetBaseSize(), gui_GetStr(), mcElementHelpers::gui_SelectStyle(), mcDRW_NONACTIVE, and mcGUILOG. |
|
Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos.
Implements mcExpElementHelpers. Definition at line 189 of file Number.cpp. References data_Get(), mcRealValue::GetNumOfDigits(), mcECL_INSIDEBASE, and mgui_nCursorPos. |
|
Returns one of the cursor position flags (called only when cursor is inside the base).
Implements mcExpElementHelpers. Definition at line 475 of file Number.cpp. References gui_GetStr(), mcCursorPos::gui_Push(), mcCP_BEGIN, mcCP_END, and mgui_nCursorPos. |
|
Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base.
Implements mcExpElementHelpers. Definition at line 450 of file Number.cpp. References mcElementHelpers::gui_GetHeightOf(), mcElementHelpers::gui_GetHeightOfChar(), gui_GetStr(), mcElementHelpers::gui_GetWidthOf(), mcElementHelpers::gui_SelectStyle(), and mgui_nCursorPos. |
|
Definition at line 251 of file Number.h. References mcRealValue::GetSmartStr(). Referenced by gui_BaseInput(), gui_DoRecalcBaseSize(), gui_DrawBase(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_Set(), and gui_SetBaseCursorPos(). |
|
Inits this section of the element. Acts like a constructor (it's called by mcElementHelpers). Reimplemented from mcExpElementHelpers. Definition at line 180 of file Number.h. References mcExpElementHelpers::gui_Init(). |
|
This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key. When the cursor is inside the exp/sub, this function is never called. Derived classes must also implement the mcElementHelpers::gui_isBeginChar function. Implements mcExpElementHelpers. Definition at line 143 of file Number.cpp. References mcMathCore::Get(), gui_isDecimalPoint(), gui_isDigit(), and mcMathCore::MatchEditKeys(). |
|
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. The begin character cannot be dependent from any variable; it must be always the same. The character is given both as ASCII code and as virtual key code.
Implements mcElementHelpers. Definition at line 136 of file Number.cpp. References gui_isDigit(). |
|
Returns TRUE if the given character is considered as a decimal point.
Definition at line 132 of file Number.h. Referenced by gui_BaseInput(), and gui_isBaseEndKey(). |
|
Returns TRUE if the given keycode is a digit (0, 1, 2, 3, 4, 5, 6, 7, 8 or 9). This utility does not belong to any specific subsection of the program because it is used almost in each of them. Definition at line 89 of file Number.cpp. Referenced by gui_BaseInput(), gui_isBaseEndKey(), gui_isBeginKey(), io_ImportBaseInlinedExpr(), and io_isBeginChar(). |
|
Returns TRUE if this element supports splitting and, thus, also merging. The default implementation returns FALSE because this is a quite unused feature. Elements which override this function and return TRUE, must override also the gui_Split() and gui_MergeWith() functions to actually do the work... Reimplemented from mcElementHelpers. |
|
Merges the given element with this object. Like splitting, very few elements support merging, but those elements which handles splitting, should also handle merging... see gui_Split(). The function should merge the given element in *this and return TRUE if everything was okay; FALSE if the merging could not be done (because, for example, the given element is not of the right type...). Reimplemented from mcElementHelpers. Definition at line 344 of file Number.cpp. References data_Get(), mcNumber::data_Get(), data_Set(), mcRealValue::GetNumOfDigits(), mcElementHelpers::gui_RecalcSize(), mcET_NUMBER, and mcRealValue::pow(). |
|
Definition at line 196 of file Number.cpp. References data_Set(), gui_GetStr(), mgui_nCursorPos, and mgui_strTrailer. Referenced by gui_BaseInput(). |
|
Sets the cursor position of the element. When this function is called with the mcCP_BEGIN flag, it must set the cursor at the leftmost point of the base; when this function is called with mcCP_END flag, the function must set the cursor at the rightmost point of the base. It should never check exponent/subscript presence: everything is handled by mcExpElement. Implements mcExpElementHelpers. Definition at line 495 of file Number.cpp. References gui_GetStr(), and mgui_nCursorPos. |
|
mcNumber is one of the few elements which supports splitting. In fact, if the user types something which is not a digit inside the number, the mcNumber is splitted in two parts. Reimplemented from mcElementHelpers. Definition at line 313 of file Number.cpp. References mcNumber::data_Get(), data_Get(), data_Set(), mcNumber::data_Set(), mcElementHelpers::gui_RecalcSize(), mcElement::gui_RecalcSize(), and mgui_nCursorPos. |
|
Implements mcExpElementHelpers. Definition at line 540 of file Number.cpp. References data_Get(), and mcRealValue::GetSmartStr(). |
|
Returns a MathML tree with the presentation math markup language regarding the base. This function should work exactly as the hononymous mcElement function.
Implements mcExpElementHelpers. Definition at line 524 of file Number.cpp. References data_Get(). |
|
Implements mcExpElementHelpers. Definition at line 566 of file Number.cpp. References mcElementHelpers::data_AddProperty(), data_Set(), gui_isDigit(), mcASSERT, and mcEP_INITIALIZED. |
|
Imports presentation MathML reading the contents of the given XML node (without modifying it).
This function is called only if io_isBeginTag function returns a positive value for the name of parent tag of
Implements mcElementHelpers. Definition at line 546 of file Number.cpp. References mcElementHelpers::data_AddProperty(), data_Set(), mcASSERT, and mcEP_INITIALIZED. |
|
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. The begin tag cannot be dependent from any variable; it must be always the same. Implements mcElementHelpers. Definition at line 517 of file Number.cpp. References gui_isDigit(). |
|
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. The begin tag cannot be dependent from any variable; it must be always the same.
Implements mcElementHelpers. |
|
|
|
Sums or subtracts this element with the given A unique function for add/subtract operations is used because the algorithms used to handle this two operations are usually almost identic and thus this avoids a lot of repetitions. If the two elements cannot be summed, then an ASSERT should fail since before using this function, the caller should always use the math_CanBeAddedWith() function.
The function returns one of mcBasicOpRes values, eventually using the Implements mcElementHelpers. Definition at line 658 of file Number.cpp. References mcNumber::data_Get(), data_Get(), data_Set(), mcASSERT, mcBOR_REMOVE_OPERAND, mcET_NUMBER, mcLOG, and mcTXTV. |
|
Returns TRUE if this element can be added with the given element. If the function returns TRUE, then the math_Add() function should return one of mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_BOTH or mcBOR_REPLACE_OPERAND. Implements mcElementHelpers. Definition at line 595 of file Number.cpp. References mcET_NUMBER. Referenced by math_CanBeMultWith(). |
|
Works like #math_CanBemath_AddeWith(), just for divisions.
Implements mcElementHelpers. Definition at line 615 of file Number.cpp. References mcNumber::data_Get(), data_Get(), mcIntegerValue::GCD(), mcIntegerValue::GetStr(), mcRealValue::isInteger(), mcIntegerValue::isPrimeTo(), mcNumber::math_isValid(), math_isValid(), math_isZero(), mcET_NUMBER, mcMATHLOG, and smath_bUseIntegersWhenPossible. |
|
Works like #math_CanBemath_AddeWith(), just for multiplication.
Implements mcElementHelpers. Definition at line 606 of file Number.cpp. References data_Get(), and math_CanBeAddedWith(). |
|
Compares this element and the given one and then stops, unlike math_Compare() that compares children too.
Reimplemented from mcElementHelpers. Definition at line 832 of file Number.cpp. References data_Get(). Referenced by math_GetGCD(). |
|
Reimplemented from mcExpElementHelpers. Definition at line 322 of file Number.h. References mcBOR_REMOVE_OPERAND. |
|
Implements mcExpElementHelpers. Definition at line 705 of file Number.cpp. References mcNumber::data_Get(), data_Get(), data_Set(), mcRealValue::GetStr(), mcRealValue::isInteger(), math_isZero(), mcASSERT, mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_OPERAND, mcET_NUMBER, mcMATHLOG, mcTXT, mcTXTTHIS, and smath_bUseIntegersWhenPossible. |
|
Implements mcExpElementHelpers. |
|
Implements mcExpElementHelpers. Definition at line 914 of file Number.cpp. References mcESR_DONE. |
|
Reimplemented from mcExpElementHelpers. Definition at line 952 of file Number.cpp. References data_Get(), and mcExpElementHelpers::math_GetBaseLCM(). |
|
Reimplemented from mcExpElementHelpers. Definition at line 325 of file Number.h. References mcRealValue::GetNumOfDigits(). |
|
Implements mcExpElementHelpers. Definition at line 330 of file Number.h. References mcMTL1_POLYNOMIAL, mcMTL2_ALGEBRAIC, and mcMTL3_CONSTANT. |
|
Reimplemented from mcExpElementHelpers. Definition at line 965 of file Number.cpp. References mcElementArray::data_AddElements(), data_Get(), mcElementHelpers::data_GetType(), mcRealValue::isInteger(), math_CompareThisOnly(), mcExpElementHelpers::math_Evaluate(), mcElement::math_Evaluate(), mcExpElementHelpers::math_GetGCD(), mcMATHLOG, mcTXT, and mcTXTTHIS. |
|
Definition at line 792 of file Number.cpp. References mcRationalValue::Canonicalize(), data_Get(), mcRationalValue::GetDen(), and mcRationalValue::GetNum(). Referenced by math_MultiplyBaseBy(), math_MultiplyBaseOnlyBy(), and math_TransformInFraction(). |
|
Returns the order position for this element.
Implements mcElementHelpers. |
|
Definition at line 299 of file Number.h. References mcValue::isValid(). Referenced by math_CanBeDivBy(). |
|
Definition at line 824 of file Number.cpp. References mcET_NUMBER. Referenced by math_CanBeDivBy(), and math_DivideBaseOnlyBy(). |
|
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. This should be the default behaviour. A simple multiplication of the current exponent by -1 should be avoided when possible.
Reimplemented from mcExpElementHelpers. Definition at line 925 of file Number.cpp. References data_Get(), mcFraction::data_GetDen(), mcFraction::data_SetNum(), mcElementArray::math_WrapSimple(), and mcBOR_REMOVE_OPERAND. |
|
Reimplemented from mcExpElementHelpers. Definition at line 747 of file Number.cpp. References data_Get(), data_Set(), mcValue::isValid(), mcElement::math_Evaluate(), mcExpElementHelpers::math_Evaluate(), math_GetNumDen(), mcASSERT, mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_OPERAND, mcET_NUMBER, and smath_bUseIntegersWhenPossible. |
|
Implements mcExpElementHelpers. Definition at line 673 of file Number.cpp. References mcNumber::data_Get(), data_Get(), data_Set(), math_GetNumDen(), mcASSERT, mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_OPERAND, mcET_NUMBER, and smath_bUseIntegersWhenPossible. |
|
Definition at line 937 of file Number.cpp. References data_Get(), and data_Set(). |
|
Definition at line 942 of file Number.cpp. References data_Get(), data_Set(), mcRealValue::GetStr(), mcMATHLOG, and mcRealValue::pow(). |
|
Implements mcExpElementHelpers. Definition at line 843 of file Number.cpp. References data_Get(), math_TransformInFraction(), mcASSERT, mcEmptyElement, mcESR_DONE, mcESR_REPLACE_THIS, and smath_bUseIntegersWhenPossible. |
|
Reimplemented from mcExpElementHelpers. Definition at line 860 of file Number.cpp. References mcExpElementHelpers::data_DestroyExpSub(), mcExpElement::data_DestroyExpSub(), data_Get(), mcExpElementHelpers::data_GetExp(), mcExpElement::data_GetExp(), data_Set(), mcNumber::data_Set(), mcElement::math_Evaluate(), mcElementHelpers::math_GetTotalLenght(), mcElement::math_GetTotalLenght(), mcESR_DONE, and mcESR_NOTFINISHED. |
|
Definition at line 806 of file Number.cpp. References mcFraction::data_GetDen(), mcFraction::data_GetNum(), math_GetNumDen(), and mcElementArray::math_WrapSimple(). Referenced by math_SimplifyBase(). |
|
|
|
The number represented by this class.
Definition at line 71 of file Number.h. Referenced by data_DeepCopy(), and data_isSameAs(). |
|
The cursor position. Note on the cursor positions available for mcExpElement::mgui_nCursorPos in the mcNumber class. Positive numbers of mgui_nCursorPos indicates the digit where the cursor is next to... example: mgui_nCursorPos=0, m_n=123 . |123 mgui_nCursorPos=3, m_n=335 . 335| mgui_nCursorPos=2, m_n=1024 . 10|24 example: mgui_nCursorPos=mcECL_INSIDEEXP, m_n=123 . 123^(...|...) mgui_nCursorPos=mcECL_ENDEXP, m_n=335 . 335^(...)| Definition at line 107 of file Number.h. Referenced by gui_BaseInput(), gui_BaseMoveCursor(), gui_BaseMoveCursorUsingPoint(), gui_EditBase(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_Set(), gui_SetBaseCursorPos(), and gui_Split(). |
|
mcNumberGUI allows the user to input decimal numbers (of any lenght) so it cannot just read the input through gui_BaseInput() and add the typed digits to mcNumber::data_m_n because if the user wants to add a zero when the cursor is placed in the rightmost digit after the comma, in this way it wouldn't work: 1234.5678| the user types "0" 1234.56780 must be the result Using a string (which is always kept sync with mcNumber::data_m_n), we can avoid such problems... Definition at line 91 of file Number.h. Referenced by data_DeepCopy(), gui_BaseInput(), and gui_Set(). |
|
The number of digits of #m_n which will be shown when exporting through the mcNumberIO functions or when viewing the graphical representation through the mcNumberGUI functions. If this variable is set to -1, then all the significant digits will be shown; if set to n, then only the first n digits of the number will be shown (padding with zeroes if significant digits are missing). Definition at line 66 of file Number.cpp. |
|
Contains the characters recognized as floating point.
Definition at line 65 of file Number.cpp. |
|
If TRUE, then fractions with integer coefficients will be used when possible, instead of decimal numbers:. 24/15 will be simplified to 8/5 instead of 1.6 Definition at line 67 of file Number.cpp. Referenced by math_CanBeDivBy(), math_DivideBaseOnlyBy(), math_MultiplyBaseBy(), math_MultiplyBaseOnlyBy(), and math_SimplifyBase(). |
|
Definition at line 61 of file Number.cpp. |
|
Definition at line 62 of file Number.cpp. |
|
A mcNumber with "1.0" as content...
Definition at line 59 of file Number.cpp. |
|
Definition at line 60 of file Number.cpp. |
|
Definition at line 63 of file Number.cpp. |
[ Top ] |