mathmaker  0.4(alpha)
Public Member Functions | Public Attributes | Properties
core.base_calculus.Quotient Class Reference

Sign, Exponented numerator, Exponented denominator, exponent. More...

Inheritance diagram for core.base_calculus.Quotient:
core.base_calculus.Operation core.root_calculus.Exponented core.root_calculus.Signed core.root_calculus.Calculable core.root_calculus.Evaluable core.base.Printable core.base.NamedObject core.base.Clonable core.base_calculus.Fraction

List of all members.

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

Detailed Description

Sign, Exponented numerator, Exponented denominator, exponent.

Definition at line 1992 of file base_calculus.py.


Constructor & Destructor Documentation

def core.base_calculus.Quotient.__init__ (   self,
  arg,
  options 
)

Constructor.

Warning:
Might raise an UncompatibleType exception.
Parameters:
argQuotient|(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.
optionsCan be use_divide_symbol
Todo:
Maybe : (RANDOMLY, num_max, deno_max) as possible argument ?
Returns:
One instance of Quotient

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().


Member Function Documentation

Returns the Quotient's length It is used in Product.into_str(), changing it will have consequences on sheets like Fractions Products & Quotients...

Returns:
1

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 
)

To check if this contains a rounded number...

Returns:
True or False

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)

Parameters:
objctThe object to search for
Returns:
True if the Quotient contains exactly the given objct

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 
)

Gets the number of '-' signs of the Quotient.

Returns:
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 
)

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.

Todo:
Other cases should return True as well (use the sign_of_product())

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.

Parameters:
objctThe other one
positionThe position (integer) of self in the Product
Returns:
True if the writing rules require × between self & obj

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.

Parameters:
positionThe position of the object in the Product
Returns:
True if the object requires brackets in a 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.

Returns:
True if the object requires inner brackets

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().


Property Documentation

core::base_calculus.Quotient::denominator [static]
core::base_calculus.Quotient::numerator [static]

The documentation for this class was generated from the following file: