mathmaker
0.4(alpha)
|
Sign, Exponented numerator, Exponented denominator, exponent. More...
Public Member Functions | |
def | __init__ |
Constructor. | |
def | get_sign |
Returns the sign of the object. | |
def | get_numerator |
Returns the numerator of the object. | |
def | get_denominator |
Returns the denominator of the object. | |
def | get_iteration_list |
Returns the list of elements to iter over. | |
def | get_minus_signs_nb |
Gets the number of '-' signs of the Quotient. | |
def | set_numerator |
Sets the numerator of the object. | |
def | set_denominator |
Sets the denominator of the object. | |
def | into_str |
Creates a string of the given object in the given ML. | |
def | evaluate |
Returns the value of a numerically evaluable object. | |
def | calculate_next_step |
Returns the Quotient in the next step of simplification. | |
def | dbg_str |
Raw display of the Quotient (debugging method) | |
def | __len__ |
Returns the Quotient's length It is used in Product.into_str(), changing it will have consequences on sheets like Fractions Products & Quotients... | |
def | operator |
Defines the performed Operation as a Quotient. | |
def | multiply_symbol_is_required |
True if the usual writing rules require a × between two factors. | |
def | requires_brackets |
True if the argument requires brackets in a product For instance, a Sum with several terms or a negative Item. | |
def | requires_inner_brackets |
True if the argument requires inner brackets The reason for requiring them is having an exponent different from 1. | |
def | contains_exactly |
True if the Quotient contains exactly the given objct It can be used to detect objects embedded in this Quotient (with a denominator equal to 1) | |
def | contains_a_rounded_number |
To check if this contains a rounded number... | |
def | invert |
Returns the inverted Quotient. | |
def | is_null |
True if the numerator is null. | |
def | is_displ_as_a_single_1 |
True if the Quotient contains only single 1-equivalent Calcs. | |
def | is_displ_as_a_single_minus_1 |
True if the Quotient can be displayed as a single -1 If the Quotient is negative and its numerator and both are equivalent to single 1. | |
def | is_displ_as_a_single_0 |
True if the Quotient can be displayed as a single 0 If the numerator is equivalent to a single 0. | |
def | is_displ_as_a_single_numeric_Item |
True if the object is or only contains one numeric Item. | |
def | is_displ_as_a_single_int |
True if the object can be displayed as a single int. | |
def | is_displ_as_a_single_neutral |
True if the object can be considered as a neutral element. | |
Public Attributes | |
sign | |
symbol | |
Properties | |
numerator | |
denominator |
Sign, Exponented numerator, Exponented denominator, exponent.
Definition at line 1992 of file base_calculus.py.
def core.base_calculus.Quotient.__init__ | ( | self, | |
arg, | |||
options | |||
) |
Constructor.
arg | Quotient|(sign, num, deno [, exponent [, symbol]]) If the argument isn't of the kinds listed above, an exception will be raised. num and deno are expected to be Exponented ; nevertheless if they are only Values they get turned into Items. |
options | Can be use_divide_symbol |
Reimplemented in core.base_calculus.Fraction.
Definition at line 2010 of file base_calculus.py.
References core.base_calculus.Quotient._denominator, core.base_calculus.Item._exponent, core.base_calculus.Function._exponent, core.base_calculus.Quotient._exponent, core.base_calculus.Quotient._numerator, core.base_calculus.Item._sign, core.base_calculus.Function._sign, core.base_calculus.SquareRoot._sign, core.base_calculus.Quotient._sign, core.base_calculus.Operation._symbol, core.base_calculus.Quotient._symbol, and core.base.Clonable.clone().
Referenced by core.calculus.Equation.__init__(), and core.root_calculus.Value.substitute().
def core.base_calculus.Quotient.__len__ | ( | self | ) |
Returns the Quotient's length It is used in Product.into_str(), changing it will have consequences on sheets like Fractions Products & Quotients...
Reimplemented from core.root_calculus.Calculable.
Definition at line 2398 of file base_calculus.py.
def core.base_calculus.Quotient.calculate_next_step | ( | self, | |
options | |||
) |
Returns the Quotient in the next step of simplification.
Reimplemented from core.root_calculus.Calculable.
Reimplemented in core.base_calculus.Fraction.
Definition at line 2309 of file base_calculus.py.
References core.base_calculus.Quotient.denominator, core.base_calculus.Item.evaluate(), core.base_calculus.Quotient.evaluate(), core.base_calculus.Item.exponent, core.root_calculus.Exponented.exponent, core.base_calculus.Fraction.exponent, core.base_calculus.Quotient.numerator, core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, core.base_calculus.Quotient.sign, core.base_calculus.Operation.symbol, and core.base_calculus.Quotient.symbol.
Referenced by core.base_calculus.Quotient.evaluate(), core.base_calculus.CommutativeOperation.evaluate(), core.base_calculus.Fraction.expand_and_reduce_next_step(), core.base_calculus.Product.expand_and_reduce_next_step(), and core.base_calculus.Sum.expand_and_reduce_next_step().
To check if this contains a rounded number...
Reimplemented from core.root_calculus.Evaluable.
Definition at line 2492 of file base_calculus.py.
def core.base_calculus.Quotient.contains_exactly | ( | self, | |
objct | |||
) |
True if the Quotient contains exactly the given objct It can be used to detect objects embedded in this Quotient (with a denominator equal to 1)
objct | The object to search for |
Reimplemented from core.root_calculus.Evaluable.
Definition at line 2470 of file base_calculus.py.
References core.base_calculus.Quotient.numerator, core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
def core.base_calculus.Quotient.dbg_str | ( | self, | |
options | |||
) |
Raw display of the Quotient (debugging method)
options | No option available so far |
Reimplemented in core.base_calculus.Fraction.
Definition at line 2377 of file base_calculus.py.
References core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
Referenced by core.base_calculus.Polynomial.__init__(), core.base_calculus.Fraction.calculate_next_step(), core.base_calculus.CommutativeOperation.evaluate(), core.base_calculus.Product.expand_and_reduce_next_step(), core.base_calculus.Sum.expand_and_reduce_next_step(), core.base_calculus.Product.get_factors_list(), core.base_calculus.Product.get_factors_list_except(), core.base_calculus.Quotient.into_str(), core.base_calculus.Product.into_str(), core.base_calculus.Quotient.is_displ_as_a_single_neutral(), core.base_calculus.Product.reduce_(), core.base_calculus.Sum.reduce_(), core.base_calculus.CommutativeOperation.remove(), core.base_calculus.Fraction.replace_striked_out(), core.root_calculus.Signed.set_opposite_sign(), core.root_calculus.Value.set_opposite_sign(), core.base_calculus.Fraction.simplified(), and core.calculus.Equation.solve_next_step().
def core.base_calculus.Quotient.get_minus_signs_nb | ( | self | ) |
Gets the number of '-' signs of the Quotient.
Reimplemented from core.root_calculus.Signed.
Definition at line 2118 of file base_calculus.py.
References core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
def core.base_calculus.Quotient.into_str | ( | self, | |
options | |||
) |
Creates a string of the given object in the given ML.
options | Any options |
Reimplemented from core.base.Printable.
Definition at line 2170 of file base_calculus.py.
References core.base_calculus.Item.dbg_str(), core.base_calculus.SquareRoot.dbg_str(), core.base_calculus.Quotient.dbg_str(), core.base_calculus.Quotient.denominator, core.root_calculus.Exponented.exponent_must_be_displayed(), core.base_calculus.Quotient.numerator, core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, core.base_calculus.Quotient.sign, core.base_calculus.Operation.symbol, and core.base_calculus.Quotient.symbol.
True if the Quotient contains only single 1-equivalent Calcs.
So, if the Quotient has a positive sign and if its numerator and both are equivalent to single 1.
Reimplemented from core.root_calculus.Calculable.
Definition at line 2535 of file base_calculus.py.
References core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
Referenced by core.base_calculus.Quotient.is_displ_as_a_single_neutral(), core.base_calculus.Product.is_reducible(), core.base_calculus.Sum.is_reducible(), and core.base_calculus.Sum.requires_inner_brackets().
True if the Quotient can be displayed as a single -1 If the Quotient is negative and its numerator and both are equivalent to single 1.
Reimplemented from core.root_calculus.Calculable.
Definition at line 2554 of file base_calculus.py.
References core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
Referenced by core.base_calculus.Product.is_reducible(), and core.base_calculus.Sum.is_reducible().
def core.base_calculus.Quotient.multiply_symbol_is_required | ( | self, | |
objct, | |||
position | |||
) |
True if the usual writing rules require a × between two factors.
objct | The other one |
position | The position (integer) of self in the Product |
Reimplemented from core.root_calculus.Calculable.
Definition at line 2420 of file base_calculus.py.
Referenced by core.base_calculus.Product.multiply_symbol_is_required(), and core.base_calculus.Sum.multiply_symbol_is_required().
def core.base_calculus.Quotient.requires_brackets | ( | self, | |
position | |||
) |
True if the argument requires brackets in a product For instance, a Sum with several terms or a negative Item.
position | The position of the object in the Product |
Reimplemented from core.root_calculus.Calculable.
Definition at line 2441 of file base_calculus.py.
References core.base_calculus.Item.sign, core.base_calculus.SquareRoot.sign, and core.base_calculus.Quotient.sign.
True if the argument requires inner brackets The reason for requiring them is having an exponent different from 1.
Reimplemented from core.root_calculus.Calculable.
Definition at line 2456 of file base_calculus.py.
References core.root_calculus.Exponented.exponent_must_be_displayed().
Referenced by core.base_calculus.Product.into_str().
core::base_calculus.Quotient::denominator [static] |
property(get_denominator,
doc = "denominator field of Quotient")
Definition at line 2132 of file base_calculus.py.
Referenced by core.base_calculus.Fraction.__cmp__(), core.base_calculus.Fraction.__init__(), core.base_calculus.Quotient.calculate_next_step(), core.base_calculus.Fraction.calculate_next_step(), core.base_calculus.Quotient.get_iteration_list(), core.base_calculus.Fraction.get_simplification_in_progress(), core.base_calculus.Quotient.into_str(), core.base_calculus.Quotient.invert(), core.base_calculus.Fraction.is_reducible(), core.base_calculus.Fraction.set_down_numerator_s_minus_sign(), and core.base_calculus.Fraction.simplification_line().
core::base_calculus.Quotient::numerator [static] |
property(get_numerator,
doc = "numerator field of Quotient")
Definition at line 2129 of file base_calculus.py.
Referenced by core.base_calculus.Fraction.__cmp__(), core.base_calculus.Fraction.__init__(), core.base_calculus.Quotient.calculate_next_step(), core.base_calculus.Fraction.calculate_next_step(), core.base_calculus.Quotient.contains_exactly(), core.base_calculus.Quotient.get_iteration_list(), core.base_calculus.Fraction.get_simplification_in_progress(), core.base_calculus.Quotient.into_str(), core.base_calculus.Quotient.invert(), core.base_calculus.Fraction.is_reducible(), core.base_calculus.Fraction.set_down_numerator_s_minus_sign(), and core.base_calculus.Fraction.simplification_line().