Integer Class Reference

#include <integerOps.hpp>

Inheritance diagram for Integer:

Inheritance graph
[legend]
Collaboration diagram for Integer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int signum () const
bool is_zero () const
bool is_not_zero () const
bool is_positive () const
bool is_negative () const
bool is_odd () const
bool is_even () const
bool is_valid () const
int size_in_bytes () const
int as_int (bool &ok) const
double as_double (bool &ok) const
smiOop as_smi (bool &ok) const
void print ()

Private Member Functions

int length () const
void set_length (int l)
Digitdigits () const
Digitoperator[] (int i) const
int length_in_bits () const

Static Private Member Functions

static int length_to_size_in_bytes (int l)

Private Attributes

int _signed_length
Digit _first_digit
Digit _debug [9999]

Friends

class IntegerOps

Detailed Description

Definition at line 36 of file integerOps.hpp.


Member Function Documentation

double Integer::as_double ( bool ok  )  const

Definition at line 174 of file integerOps.cpp.

References assert, double_length, exponent(), exponent_bias, exponent_length, is_negative(), is_zero(), length(), length_in_bits(), logB, mantissa_length, max_exponent, operator[](), shift_left(), shift_right(), and sign_length.

Referenced by convert_to_double(), and PRIM_DECL_1().

Here is the call graph for this function:

int Integer::as_int ( bool ok  )  const

Definition at line 157 of file integerOps.cpp.

References _first_digit, and _signed_length.

smiOop Integer::as_smi ( bool ok  )  const

Definition at line 216 of file integerOps.cpp.

References _first_digit, _signed_length, as_smiOop(), smi_max, and smi_min.

Referenced by simplified().

Here is the call graph for this function:

Digit* Integer::digits (  )  const [inline, private]

Definition at line 44 of file integerOps.hpp.

References _first_digit.

Referenced by operator[](), and IntegerOps::qr_decomposition().

bool Integer::is_even (  )  const [inline]

Definition at line 59 of file integerOps.hpp.

References is_odd().

Here is the call graph for this function:

bool Integer::is_negative (  )  const [inline]

Definition at line 56 of file integerOps.hpp.

References signum().

Referenced by IntegerOps::abs(), IntegerOps::add(), IntegerOps::add_result_size_in_bytes(), as_double(), IntegerOps::cmp(), IntegerOps::div(), IntegerOps::div_result_size_in_bytes(), IntegerOps::Integer_to_string(), IntegerOps::mod(), IntegerOps::mod_result_size_in_bytes(), IntegerOps::mul(), IntegerOps::quo(), IntegerOps::rem(), IntegerOps::sub(), and IntegerOps::sub_result_size_in_bytes().

Here is the call graph for this function:

bool Integer::is_not_zero (  )  const [inline]

Definition at line 54 of file integerOps.hpp.

References signum().

Referenced by IntegerOps::Integer_to_string(), and is_odd().

Here is the call graph for this function:

bool Integer::is_odd (  )  const [inline]

Definition at line 58 of file integerOps.hpp.

References _first_digit, and is_not_zero().

Referenced by is_even().

Here is the call graph for this function:

bool Integer::is_positive (  )  const [inline]

Definition at line 55 of file integerOps.hpp.

References signum().

Referenced by IntegerOps::and(), IntegerOps::and_result_size_in_bytes(), IntegerOps::div(), IntegerOps::div_result_size_in_bytes(), IntegerOps::mod(), IntegerOps::mod_result_size_in_bytes(), IntegerOps::or(), IntegerOps::or_result_size_in_bytes(), IntegerOps::xor(), and IntegerOps::xor_result_size_in_bytes().

Here is the call graph for this function:

bool Integer::is_valid (  )  const [inline]

Definition at line 61 of file integerOps.hpp.

References is_zero(), length(), and operator[]().

Referenced by PRIM_DECL_2().

Here is the call graph for this function:

bool Integer::is_zero (  )  const [inline]

Definition at line 53 of file integerOps.hpp.

References signum().

Referenced by as_double(), is_valid(), length_in_bits(), IntegerOps::mul(), PRIM_DECL_2(), and IntegerOps::unsigned_mul_result_length().

Here is the call graph for this function:

int Integer::length (  )  const [inline, private]

Definition at line 42 of file integerOps.hpp.

References _signed_length.

Referenced by IntegerOps::and(), IntegerOps::and_result_size_in_bytes(), as_double(), IntegerOps::copy(), IntegerOps::first_digit(), IntegerOps::Integer_to_string_result_size_in_bytes(), is_valid(), IntegerOps::last_digit(), length_in_bits(), IntegerOps::mul(), IntegerOps::or(), IntegerOps::or_result_size_in_bytes(), IntegerOps::qr_decomposition(), size_in_bytes(), IntegerOps::unsigned_add(), IntegerOps::unsigned_add_result_length(), IntegerOps::unsigned_cmp(), IntegerOps::unsigned_mul(), IntegerOps::unsigned_mul_result_length(), IntegerOps::unsigned_quo(), IntegerOps::unsigned_quo_result_length(), IntegerOps::unsigned_rem(), IntegerOps::unsigned_rem_result_length(), IntegerOps::unsigned_sub(), IntegerOps::unsigned_sub_result_length(), IntegerOps::xor(), and IntegerOps::xor_result_size_in_bytes().

int Integer::length_in_bits (  )  const [private]

Definition at line 147 of file integerOps.cpp.

References is_zero(), length(), logB, and operator[]().

Referenced by as_double().

Here is the call graph for this function:

static int Integer::length_to_size_in_bytes ( int  l  )  [inline, static, private]

Definition at line 47 of file integerOps.hpp.

Referenced by IntegerOps::add_result_size_in_bytes(), IntegerOps::and_result_size_in_bytes(), IntegerOps::div_result_size_in_bytes(), IntegerOps::double_to_Integer_result_size_in_bytes(), IntegerOps::int_to_Integer_result_size_in_bytes(), IntegerOps::mod_result_size_in_bytes(), IntegerOps::mul_result_size_in_bytes(), IntegerOps::or_result_size_in_bytes(), IntegerOps::quo_result_size_in_bytes(), IntegerOps::rem_result_size_in_bytes(), size_in_bytes(), IntegerOps::string_to_Integer_result_size_in_bytes(), IntegerOps::sub_result_size_in_bytes(), and IntegerOps::xor_result_size_in_bytes().

Digit& Integer::operator[] ( int  i  )  const [inline, private]

Definition at line 45 of file integerOps.hpp.

References digits().

Referenced by as_double(), is_valid(), and length_in_bits().

Here is the call graph for this function:

void Integer::print (  ) 

Definition at line 233 of file integerOps.cpp.

References IntegerOps::Integer_to_string(), outputStream::print(), and std.

Referenced by convert_from_string(), convert_to_integer(), factorial(), and unfactorial().

Here is the call graph for this function:

void Integer::set_length ( int  l  )  [inline, private]

Definition at line 43 of file integerOps.hpp.

References _signed_length.

Referenced by IntegerOps::and(), IntegerOps::double_to_Integer(), IntegerOps::first_digit(), IntegerOps::int_to_Integer(), IntegerOps::last_digit(), IntegerOps::mul(), IntegerOps::neg(), IntegerOps::or(), IntegerOps::unsigned_add(), IntegerOps::unsigned_mul(), IntegerOps::unsigned_quo(), IntegerOps::unsigned_rem(), IntegerOps::unsigned_sub(), and IntegerOps::xor().

int Integer::signum (  )  const [inline]

Definition at line 52 of file integerOps.hpp.

References _signed_length.

Referenced by IntegerOps::cmp(), is_negative(), is_not_zero(), is_positive(), and is_zero().

int Integer::size_in_bytes (  )  const [inline]

Definition at line 62 of file integerOps.hpp.

References length(), and length_to_size_in_bytes().

Referenced by IntegerOps::copy_result_size_in_bytes(), and IntegerOps::Integer_to_string().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class IntegerOps [friend]

Definition at line 70 of file integerOps.hpp.


Member Data Documentation

Digit Integer::_debug[9999] [private]

Definition at line 40 of file integerOps.hpp.

Digit Integer::_first_digit [private]

Definition at line 39 of file integerOps.hpp.

Referenced by as_int(), as_smi(), digits(), IntegerOps::int_to_Integer(), is_odd(), and IntegerOps::qr_decomposition().

int Integer::_signed_length [private]

Definition at line 38 of file integerOps.hpp.

Referenced by as_int(), as_smi(), IntegerOps::copy(), length(), IntegerOps::neg(), set_length(), and signum().


The documentation for this class was generated from the following files:
Generated on Mon Oct 9 14:00:23 2006 for Strongtalk VM by  doxygen 1.4.7