IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
Represents a real number. More...
Public Member Functions | |
Counter (Counter v) | |
void | Copy (Counter s) |
Copies a counter to the current counter. | |
void | Copy (long l) |
Copies double to the current counter. | |
int | Compare (Counter a, Counter b) |
override bool | Equals (object obj) |
Indicates whether obj is equal to this instance. | |
bool | Equals (Counter a) |
Indicates whether a is equal to this instance. | |
override int | GetHashCode () |
Gets the hashcode of this Counter . | |
int | CompareTo (Counter other) |
Compare this Counter with another Counter. | |
override string | ToString () |
Returns standard string representation of a counter, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy. | |
string | ToString (string format, IFormatProvider formatProvider) |
Returns a string representation of a counter in the specified way. | |
int | read (string str) |
Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
int | Read (string str, int startpos) |
Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
int | Read (string str, int startpos, bool skipspaces) |
Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
void | Copy (string str) |
Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter. | |
bool | TryCopy (string str) |
Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case. | |
Static Public Member Functions | |
static void | Copy (Counter a, ref Counter res) |
Copies a counter to another (existing) counter in place. | |
static void | Copy (long a, ref Counter res) |
Copies a number to an (existing) counter in place. | |
static Counter | MinValue () |
Creates a counter that contains minimal representable value. | |
static Counter | MaxValue () |
Creates a counter that contains maximal representable value. | |
static Counter | operator+ (Counter s) |
static Counter | operator- (Counter s) |
static Counter | operator+ (Counter a, Counter b) |
static Counter | operator- (Counter a, Counter b) |
static Counter | operator* (Counter a, Counter b) |
static Counter | operator/ (Counter a, Counter b) |
static bool | operator== (Counter a, Counter b) |
static bool | operator!= (Counter a, Counter b) |
static bool | operator< (Counter a, Counter b) |
static bool | operator> (Counter a, Counter b) |
static bool | operator<= (Counter a, Counter b) |
static bool | operator>= (Counter a, Counter b) |
static implicit | operator long (Counter a) |
Explicit conversion from Counter to long. | |
static implicit | operator Counter (long a) |
Implicit conversion from long to Counter . | |
static int | Read (ref Counter result, string str) |
Reads a counter from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
static int | Read (ref Counter result, string str, int startpos) |
Reads a counter from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
static int | Read (ref Counter result, string str, int startpos, bool skipspaces) |
Reads a counter from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter. | |
static Counter | Parse (string str) |
Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter. | |
static bool | TryParse (string str, ref Counter result) |
Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case. | |
static void | Examples () |
Examples of using the Counter class. | |
Public Attributes | |
long | Value |
Value of the counter. | |
Properties | |
static Counter | One [get] |
Returns a counter with value 1. | |
static Counter | Zero [get] |
Returns a counter with value 0. | |
bool | IsNaN [get] |
Indicates whether the current Counter is not a number. | |
bool | IsPositiveInfinity [get] |
Indicates whether the current Counter represents positive infinity. | |
bool | IsNegativeInfinity [get] |
Indicates whether the current Counter represents negative infinity. | |
bool | IsInfinity [get] |
Indicates whether the current Counter represents infinity. |
Represents a real number.
IG::Num::Counter::Counter | ( | Counter | v | ) | [inline] |
void IG::Num::Counter::Copy | ( | Counter | s | ) | [inline] |
Copies a counter to the current counter.
void IG::Num::Counter::Copy | ( | long | l | ) | [inline] |
Copies double to the current counter.
static void IG::Num::Counter::Copy | ( | long | a, |
ref Counter | res | ||
) | [inline, static] |
Copies a number to an (existing) counter in place.
a | Number that is copied. |
res | Counter where result is stored. |
static Counter IG::Num::Counter::MinValue | ( | ) | [inline, static] |
Creates a counter that contains minimal representable value.
static Counter IG::Num::Counter::MaxValue | ( | ) | [inline, static] |
Creates a counter that contains maximal representable value.
override bool IG::Num::Counter::Equals | ( | object | obj | ) | [inline] |
Indicates whether obj
is equal to this instance.
bool IG::Num::Counter::Equals | ( | Counter | a | ) | [inline] |
Indicates whether a
is equal to this instance.
override int IG::Num::Counter::GetHashCode | ( | ) | [inline] |
Gets the hashcode of this Counter
.
int IG::Num::Counter::CompareTo | ( | Counter | other | ) | [inline] |
static implicit IG::Num::Counter::operator long | ( | Counter | a | ) | [inline, static] |
Explicit conversion from Counter
to long.
static implicit IG::Num::Counter::operator Counter | ( | long | a | ) | [inline, static] |
Implicit conversion from long to Counter
.
override string IG::Num::Counter::ToString | ( | ) | [inline] |
Returns standard string representation of a counter, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy.
string IG::Num::Counter::ToString | ( | string | format, |
IFormatProvider | formatProvider | ||
) | [inline] |
Returns a string representation of a counter in the specified way.
format | the format string. |
formatProvider | The bormat provider used. |
static int IG::Num::Counter::Read | ( | ref Counter | result, |
string | str | ||
) | [inline, static] |
Reads a counter from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
result | Output parameter returning the counter that was read. |
str | String from which the counter is read. |
static int IG::Num::Counter::Read | ( | ref Counter | result, |
string | str, | ||
int | startpos | ||
) | [inline, static] |
Reads a counter from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
result | Output parameter returning the counter that was read. |
str | String from which the counter is read. |
startpos | Starting position from which counter is searched for. |
at the starting position.
static int IG::Num::Counter::Read | ( | ref Counter | result, |
string | str, | ||
int | startpos, | ||
bool | skipspaces | ||
) | [inline, static] |
Reads a counter from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
result | Output parameter returning the counter that was read. |
str | String from which the counter is read. |
startpos | Starting position from which counter is searched for. |
skipspaces | If true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position. |
static Counter IG::Num::Counter::Parse | ( | string | str | ) | [inline, static] |
Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter.
str | String that is parsed. |
static bool IG::Num::Counter::TryParse | ( | string | str, |
ref Counter | result | ||
) | [inline, static] |
Parses a counter from a string and returns it. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.
str | String that is parsed. |
int IG::Num::Counter::read | ( | string | str | ) | [inline] |
Reads in the value from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
str | String from which the counter is read. |
int IG::Num::Counter::Read | ( | string | str, |
int | startpos | ||
) | [inline] |
Reads in the value from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
result | Output parameter returning the counter that was read. |
str | String from which the counter is read. |
startpos | Starting position from which counter is searched for. |
at the starting position.
int IG::Num::Counter::Read | ( | string | str, |
int | startpos, | ||
bool | skipspaces | ||
) | [inline] |
Reads in the value from a string, starting at a specified position. Returns the position of the first character after the read counter (or -1 if reading failed) and outputs the read counter.
str | String from which the counter is read. |
startpos | Starting position from which counter is searched for. |
skipspaces | If true then leading spaces are ignored, otherwise operation fails if there is a whitespace at the starting position. |
void IG::Num::Counter::Copy | ( | string | str | ) | [inline] |
Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a counter.
str | String that is parsed. |
bool IG::Num::Counter::TryCopy | ( | string | str | ) | [inline] |
Parses a counter from a string and sets the value to the parsed counter. Leading and trailing spaces are ignored, but other characters are not. false is returned if parsing was not successful, but no exception is thrown in this case.
str | String that is parsed. |
static void IG::Num::Counter::Examples | ( | ) | [inline, static] |
Examples of using the Counter class.
Value of the counter.
Counter IG::Num::Counter::One [static, get] |
Returns a counter with value 1.
Counter IG::Num::Counter::Zero [static, get] |
Returns a counter with value 0.
bool IG::Num::Counter::IsNaN [get] |
Indicates whether the current Counter
is not a number.
bool IG::Num::Counter::IsPositiveInfinity [get] |
Indicates whether the current Counter
represents positive infinity.
bool IG::Num::Counter::IsNegativeInfinity [get] |
Indicates whether the current Counter
represents negative infinity.
bool IG::Num::Counter::IsInfinity [get] |
Indicates whether the current Counter
represents infinity.