IGLib
1.7.2
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. More... | |
void | Copy (long l) |
Copies double to the current counter. More... | |
int | Compare (Counter a, Counter b) |
override bool | Equals (object obj) |
Indicates whether obj is equal to this instance. More... | |
bool | Equals (Counter a) |
Indicates whether a is equal to this instance. More... | |
override int | GetHashCode () |
Gets the hashcode of this Counter . More... | |
int | CompareTo (Counter other) |
Compare this Counter with another Counter. More... | |
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. More... | |
string | ToString (string format, IFormatProvider formatProvider) |
Returns a string representation of a counter in the specified way. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Static Public Member Functions | |
static void | Copy (Counter a, ref Counter res) |
Copies a counter to another (existing) counter in place. More... | |
static void | Copy (long a, ref Counter res) |
Copies a number to an (existing) counter in place. More... | |
static Counter | MinValue () |
Creates a counter that contains minimal representable value. More... | |
static Counter | MaxValue () |
Creates a counter that contains maximal representable value. More... | |
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. More... | |
static implicit | operator Counter (long a) |
Implicit conversion from long to Counter . More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static void | Examples () |
Examples of using the Counter class More... | |
Public Attributes | |
long | Value |
Value of the counter. More... | |
Properties | |
static Counter | One [get] |
Returns a counter with value 1. More... | |
static Counter | Zero [get] |
Returns a counter with value 0. More... | |
bool | IsNaN [get] |
Indicates whether the current Counter is not a number. More... | |
bool | IsPositiveInfinity [get] |
Indicates whether the current Counter represents positive infinity. More... | |
bool | IsNegativeInfinity [get] |
Indicates whether the current Counter represents negative infinity. More... | |
bool | IsInfinity [get] |
Indicates whether the current Counter represents infinity. More... | |
Represents a real number.
|
inline |
References IG.Num.Counter.Value.
|
inline |
Copies a counter to the current counter.
References IG.Num.Counter.Value.
|
inline |
Copies double to the current counter.
Copies a counter to another (existing) counter in place.
References IG.Num.Counter.Value.
|
inlinestatic |
Copies a number to an (existing) counter in place.
a | Number that is copied. |
res | Counter where result is stored. |
|
inlinestatic |
Creates a counter that contains minimal representable value.
|
inlinestatic |
Creates a counter that contains maximal representable value.
References IG.Num.Counter.Value.
|
inline |
Indicates whether obj
is equal to this instance.
|
inline |
Indicates whether a
is equal to this instance.
References IG.Num.Counter.IsNaN, and IG.Num.Counter.Value.
|
inline |
Gets the hashcode of this Counter
.
|
inline |
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
References IG.Num.Counter.Value.
|
inlinestatic |
Explicit conversion from Counter
to long.
References IG.Num.Counter.Value.
|
inlinestatic |
Implicit conversion from long to Counter
.
|
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.
Referenced by IG.Num.Counter.Examples().
|
inline |
Returns a string representation of a counter in the specified way.
format | the format string. |
formatProvider | The bormat provider used. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
References IG.Lib.Parser.ReadInteger().
|
inlinestatic |
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. |
References IG.Num.s, and IG.Lib.Parser.SkipSpaces().
|
inlinestatic |
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. |
result | Variable where result is stored. |
References IG.Num.s, and IG.Lib.Parser.SkipSpaces().
|
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. |
|
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.
str | String from which the counter is read. |
startpos | Starting position from which counter is searched for. |
|
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. |
|
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. |
References IG.Num.s.
|
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. |
|
inlinestatic |
Examples of using the Counter class
References IG.Num.Counter.ToString().
long IG.Num.Counter.Value |
Value of the counter.
Referenced by IG.Num.Counter.Compare(), IG.Num.Counter.Copy(), IG.Num.Counter.Counter(), IG.Num.Counter.Equals(), IG.Num.Counter.operator long(), IG.Num.Counter.operator!=(), IG.Num.Counter.operator*(), IG.Num.Counter.operator+(), IG.Num.Counter.operator-(), IG.Num.Counter.operator/(), IG.Num.Counter.operator<(), IG.Num.Counter.operator<=(), IG.Num.Counter.operator==(), IG.Num.Counter.operator>(), and IG.Num.Counter.operator>=().
|
staticget |
Returns a counter with value 1.
|
staticget |
Returns a counter with value 0.
|
get |
Indicates whether the current Counter
is not a number.
Referenced by IG.Num.Counter.Equals().
|
get |
Indicates whether the current Counter
represents positive infinity.
|
get |
Indicates whether the current Counter
represents negative infinity.
|
get |
Indicates whether the current Counter
represents infinity.