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

- Main Page
- Namespaces
- Classes
- Files
- Directories

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

Public Member Functions | Static Public Member Functions | Public Attributes | Properties

# IG::Num::Counter Struct Reference

Represents a real number. More...

List of all members.

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

## Detailed Description

Represents a real number.

## Constructor & Destructor Documentation

IG::Num::Counter::Counter | ( | Counter | v | ) | `[inline]`

## Member Function Documentation

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

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]`

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]`

Compare this Counter with another Counter.

Parameters:

  s | The counter to compare with.

static Counter IG::Num::Counter::operator+ | ( | Counter | s | ) | `[inline, static]`

static Counter IG::Num::Counter::operator- | ( | Counter | s | ) | `[inline, static]`

static Counter IG::Num::Counter::operator+ | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static Counter IG::Num::Counter::operator- | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static Counter IG::Num::Counter::operator* | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static Counter IG::Num::Counter::operator/ | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator== | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator!= | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator< | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator> | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator<= | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

static bool IG::Num::Counter::operator>= | ( | Counter | a,
|  | Counter | b
| ) |  | `[inline, static]`

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.

Returns:
  String representing te counter.

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.

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.

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.

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.

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.

## Member Data Documentation

long IG::Num::Counter::Value

Value of the counter.

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

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:

- Scalar.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events