| IGLib 1.5 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
IG.Num.Counter Struct Reference

Represents a real number. More...

Inheritance diagram for IG.Num.Counter:
[legend]
Collaboration diagram for IG.Num.Counter:
[legend]

## 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...

## Detailed Description

Represents a real number.

## Constructor & Destructor Documentation

IG.Num.Counter.Counter | ( | Counter | v | ) |
| inline

References IG.Num.Counter.Value.

## Member Function Documentation

void IG.Num.Counter.Copy | ( | Counter | s | ) |
| inline

Copies a counter to the current counter.

References IG.Num.Counter.Value.

void IG.Num.Counter.Copy | ( | long | l | ) |
| inline

Copies double to the current counter.

static void IG.Num.Counter.Copy | ( | Counter | a,
|  | ref Counter | res
| ) |  |
| inline static

Copies a counter to another (existing) counter in place.

Parameters

  a | Counter that is copied.
  res | Counter where result is stored.

References IG.Num.Counter.Value.

static void IG.Num.Counter.Copy | ( | long | a,
|  | ref Counter | res
| ) |  |
| inline static

Copies a number to an (existing) counter in place.

Parameters

  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.

int IG.Num.Counter.Compare | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline

References IG.Num.Counter.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.

References IG.Num.Counter.IsNaN, and IG.Num.Counter.Value.

override int IG.Num.Counter.GetHashCode | ( |  | ) |
| inline

Gets the hashcode of this `Counter`.

int IG.Num.Counter.CompareTo | ( | Counter | other | ) |
| inline

Compare this Counter with another Counter.

Parameters

  s | The counter to compare with.

static Counter IG.Num.Counter.operator+ | ( | Counter | s | ) |
| inline static

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator- | ( | Counter | s | ) |
| inline static

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator+ | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator- | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator* | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static Counter IG.Num.Counter.operator/ | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator== | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator!= | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator< | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator> | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator<= | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static bool IG.Num.Counter.operator>= | ( | Counter | a,
|  | Counter | b
| ) |  |
| inline static

References IG.Num.Counter.Value.

static implicit IG.Num.Counter.operator long | ( | Counter | a | ) |
| inline static

Explicit conversion from `Counter` to long.

References IG.Num.Counter.Value.

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.

Returns
  String representing te counter.

Referenced by IG.Num.Counter.Examples().

string IG.Num.Counter.ToString | ( | string | format,
|  | IFormatProvider | formatProvider
| ) |  |
| inline

Returns a string representation of a counter in the specified way.

Parameters

  format | the format string.
  formatProvider | The bormat provider used.

Returns
  String representation of the counter.

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.

Parameters

  result | Output parameter returning the counter that was read.
  str | String from which the counter is read.

Returns
  Position right after the read counter, or -1 if reading was not successful.

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.

Parameters

  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.

Returns
  Position right after the read counter, or -1 if reading was not successful.

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.

Parameters

  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.

Returns
  Position right after the read counter, or -1 if reading was not successful.

References IG.Lib.Parser.ReadInteger().

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.

Parameters

  str | String that is parsed.

Returns
  The counter represented by the parsed string.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

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.

Parameters

  str | String that is parsed.

Returns
  True if parsing was successful (and the counter was actually read), false otherwise.

References IG.Num.s, and IG.Lib.Parser.SkipSpaces().

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.

Parameters

  str | String from which the counter is read.

Returns
  Position right after the read counter, or -1 if reading was not successful.

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.

Parameters

  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.

Returns
  Position right after the read counter, or -1 if reading was not successful.

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.

Parameters

  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.

Returns
  Position right after the read counter, or -1 if reading was not successful.

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.

Parameters

  str | String that is parsed.

References IG.Num.s.

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.

Parameters

  str | String that is parsed.

Returns
  True if parsing was successful (and the counter was actually read), false otherwise.

static void IG.Num.Counter.Examples | ( |  | ) |
| inline static

Examples of using the Counter class

References IG.Num.Counter.ToString().

## Member Data Documentation

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>=().

## Property Documentation

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.

Referenced by IG.Num.Counter.Equals().

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.

The documentation for this struct was generated from the following file:

- igbase/numeric/Scalar.cs