obj::calc::Quotient Class Reference

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

Inheritance diagram for obj::calc::Quotient:
obj::calc::Exponented obj::calc::Calculable obj::Printable obj::calc::Fraction

List of all members.

Public Member Functions

def __init__
 Constructor.
def __str__
 Raw display of the Quotient (debugging method).
def __len__
 Returns the Quotient's length It is used in Product.make_string(), changing it will have consequences on sheets like Fractions Products & Quotients.
def is_numeric
 True if the Quotient contains only numeric Exponenteds.
def is_literal
 True if the Quotient contains only literal Exponenteds.
def is_null
 True if the numerator is null.
def is_negative
 True if the sign before the Quotient is '-'.
def is_positive
 True if the sign before the Quotient is '+'.
def is_equivalent_to_a_single_1
 True if the Quotient contains only single 1-equivalent Calcs.
def is_equivalent_to_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_equivalent_to_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_equivalent_to_a_single_numeric_Item
 True if the object is or only contains one numeric Item.
def is_equivalent_to_an_irreducible_Fraction
 True if the object is or only contains one irreducible Fraction.
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 get_sign
 Returns the sign of the Quotient.
def get_minus_signs_nb
 Gets the number of '-' signs of the Quotient.
def evaluate
 Returns the value of a numerically evaluable object.
def invert
 Returns the inverted Quotient.
def calculate_next_step
 Returns the Quotient in the next step of simplification.
def make_string
 Creates a string of the given object in the given ML.

Detailed Description

Sign, Exponented numerator, Exponented denominator, exponent.

Definition at line 6129 of file __init__.py.


Member Function Documentation

def obj::calc::Quotient::__init__ (   self,
  arg,
  options 
)

Constructor.

Warning:
Might raise an UncompatibleType exception.
Parameters:
arg Quotient|(sign, num, deno [, exponent [, symbol]]) If the argument isn't of the kinds listed above, an exception will be raised.
options Can be use_divide_symbol
Todo:
Maybe : (__.RANDOMLY, num_max, deno_max) as possible argument ?
Returns:
One instance of Quotient

Reimplemented in obj::calc::Fraction.

Definition at line 6146 of file __init__.py.

def obj::calc::Quotient::__len__ (   self  ) 

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

..

Returns:
1

Definition at line 6232 of file __init__.py.

def obj::calc::Quotient::__str__ (   self,
  options 
)

Raw display of the Quotient (debugging method).

Parameters:
options No option available so far
Returns:
A string : "Q# sign ( numerator / denominator )^{ exponent }#Q"

Reimplemented in obj::calc::Fraction.

Definition at line 6211 of file __init__.py.

def obj::calc::Quotient::calculate_next_step (   self,
  options 
)

Returns the Quotient in the next step of simplification.

Todo:
The case where exponent has to be calculated as well.

Reimplemented from obj::calc::Exponented.

Reimplemented in obj::calc::Fraction.

Definition at line 6533 of file __init__.py.

def obj::calc::Quotient::contains_a_rounded_number (   self  ) 

To check if this contains a rounded number.

..

Returns:
True or False

Reimplemented from obj::calc::Exponented.

Definition at line 6455 of file __init__.py.

def obj::calc::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:
objct The object to search for
Returns:
True if the Quotient contains exactly the given objct

Reimplemented from obj::calc::Exponented.

Definition at line 6433 of file __init__.py.

def obj::calc::Quotient::get_minus_signs_nb (   self  ) 

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

Returns:
The number of '-' signs of the Quotient

Reimplemented from obj::calc::Exponented.

Definition at line 6484 of file __init__.py.

def obj::calc::Quotient::is_equivalent_to_a_single_1 (   self  ) 

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 obj::calc::Calculable.

Definition at line 6310 of file __init__.py.

def obj::calc::Quotient::is_equivalent_to_a_single_minus_1 (   self  ) 

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 obj::calc::Calculable.

Definition at line 6329 of file __init__.py.

def obj::calc::Quotient::is_negative (   self  ) 

True if the sign before the Quotient is '-'.

Todo:
How to manage the case of 0 ?

Definition at line 6278 of file __init__.py.

def obj::calc::Quotient::is_positive (   self  ) 

True if the sign before the Quotient is '+'.

Todo:
How to answer to the question if this Item is null ?

Definition at line 6293 of file __init__.py.

def obj::calc::Quotient::make_string (   self,
  markup,
  options 
)

Creates a string of the given object in the given ML.

Parameters:
markup The markup dictionary to use
options Any options
Returns:
The formated string

Reimplemented from obj::Printable.

Definition at line 6599 of file __init__.py.

def obj::calc::Quotient::multiply_symbol_is_required (   self,
  objct,
  position 
)

True if the usual writing rules require a × between two factors.

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

Reimplemented from obj::calc::Exponented.

Definition at line 6383 of file __init__.py.

def obj::calc::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:
position The position of the object in the Product
Returns:
True if the object requires brackets in a Product

Reimplemented from obj::calc::Exponented.

Definition at line 6404 of file __init__.py.

def obj::calc::Quotient::requires_inner_brackets (   self  ) 

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 obj::calc::Exponented.

Definition at line 6419 of file __init__.py.


The documentation for this class was generated from the following file:
Generated on Fri Dec 30 19:26:37 2011 for mathmaker by  doxygen 1.6.3