obj::calc::SquareRoot Class Reference

It's a Exponented under a square root The Exponented can be either numeric or literal. More...

Inheritance diagram for obj::calc::SquareRoot:
obj::calc::Exponented obj::calc::Calculable obj::Printable

List of all members.

Public Member Functions

def __init__
 Constructor.
def __str__
 Raw display of the SquareRoot (debugging method).
def __cmp__
 Compares two SquareRoots.
def __len__
 Returns the SquareRoot's length.
def is_numeric
 True if it's a numeric SquareRoot.
def is_literal
 True if it's a literal SquareRoot.
def is_null
 True if it's the null SquareRoot.
def is_negative
 True if SquareRoot's *sign* is '-'.
def is_positive
 True if SquareRoot's *sign* is '+'.
def turn_into_fraction
 Turns the SquareRoot into the fraction item itself over item 1.
def is_equivalent_to_a_single_1
 True if it's positive w/ radicand itself eq.
def is_equivalent_to_a_single_minus_1
 True if it's negative w/ radicand itself eq.
def is_equivalent_to_a_single_0
 True if self.is_null().
def is_equivalent_to_a_single_numeric_Item
 Should never be True (if it is, then self is not a SquareRoot.
def is_equivalent_to_an_irreducible_Fraction
 Should never be True for a SquareRoot.
def is_expandable
 Depends on the radicand.
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
 Always false for SquareRoots !
def contains_exactly
 Always False for a SquareRoot ?
def contains_a_rounded_number
 To check if this contains a rounded number.
def get_sign
 Gets the sign of the SquareRoot.
def get_minus_signs_nb
 Gets the number of '-' signs of the SquareRoot.
def calculate_next_step
 Returns None|an SquareRoot.
def expand_and_reduce_next_step
 Returns self.object.expand_and_reduce_next_step().
def make_string
 Creates a string of the given object in the given ML.

Detailed Description

It's a Exponented under a square root The Exponented can be either numeric or literal.

Definition at line 1884 of file __init__.py.


Member Function Documentation

def obj::calc::SquareRoot::__cmp__ (   self,
  other_item 
)

Compares two SquareRoots.

Returns:
0 (i.e. they're equal) if sign, value & exponent are equal ?

Definition at line 1958 of file __init__.py.

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

Constructor.

Warning:
Might raise an UncompatibleType exception.
Parameters:
arg Exponented|(sign, Exponented) The given Exponented will be "embedded" in the SquareRoot
options : copy='yes' can be used to produce a copy of another SquareRoot. If not used, the other SquareRoot will get embedded in a new SquareRoot.
Returns:
One instance of SquareRoot

Definition at line 1900 of file __init__.py.

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

Returns the SquareRoot's length.

Returns:
1

Definition at line 1970 of file __init__.py.

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

Raw display of the SquareRoot (debugging method).

Parameters:
options No option available so far
Returns:
A string containing "signSQR{{str(object)}}"

Definition at line 1943 of file __init__.py.

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

Returns None|an SquareRoot.

Todo:
Manage the case when the exponent is a calculable that should be calculated itself.
Warning:
Relays an exception if the content is negative

Reimplemented from obj::calc::Exponented.

Definition at line 2230 of file __init__.py.

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

To check if this contains a rounded number.

..

Returns:
True or False depending on the Value inside

Reimplemented from obj::calc::Exponented.

Definition at line 2188 of file __init__.py.

def obj::calc::SquareRoot::contains_exactly (   self,
  objct 
)

Always False for a SquareRoot ?

Parameters:
objct The object to search for
Returns:
False

Reimplemented from obj::calc::Exponented.

Definition at line 2176 of file __init__.py.

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

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

Returns:
The number of '-' signs of the SquareRoot (either 0 or 1)

Reimplemented from obj::calc::Exponented.

Definition at line 2214 of file __init__.py.

def obj::calc::SquareRoot::get_sign (   self  ) 

Gets the sign of the SquareRoot.

Returns:
The sign of the SquareRoot

Reimplemented from obj::calc::Exponented.

Definition at line 2200 of file __init__.py.

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

True if it's positive w/ radicand itself eq.

to a single 1

Reimplemented from obj::calc::Calculable.

Definition at line 2051 of file __init__.py.

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

True if it's negative w/ radicand itself eq.

to a single 1

Reimplemented from obj::calc::Calculable.

Definition at line 2064 of file __init__.py.

def obj::calc::SquareRoot::is_equivalent_to_a_single_numeric_Item (   self  ) 

Should never be True (if it is, then self is not a SquareRoot.

..)

Reimplemented from obj::calc::Calculable.

Definition at line 2088 of file __init__.py.

def obj::calc::SquareRoot::is_expandable (   self  ) 

Depends on the radicand.

Returns:
True/False

Definition at line 2108 of file __init__.py.

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

True if SquareRoot's *sign* is '-'.

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

Definition at line 2011 of file __init__.py.

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

True if SquareRoot's *sign* is '+'.

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

Definition at line 2026 of file __init__.py.

def obj::calc::SquareRoot::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 2296 of file __init__.py.

def obj::calc::SquareRoot::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 2121 of file __init__.py.

def obj::calc::SquareRoot::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 2143 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