IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Represents a real number. More...
Public Member Functions | |
Scalar (Scalar v) | |
Scalar (double v) | |
void | Copy (Scalar s) |
Copies a scalar to the current scalar. More... | |
void | Copy (double d) |
Copies double to the current scalar. More... | |
int | Compare (Scalar a, Scalar b) |
override bool | Equals (object obj) |
Indicates whether obj is equal to this instance. More... | |
bool | Equals (Scalar a) |
Indicates whether a is equal to this instance. More... | |
override int | GetHashCode () |
Gets the hashcode of this Scalar . More... | |
int | CompareTo (Scalar other) |
Compare this Scalar with another Scalar. More... | |
override string | ToString () |
Returns standard string representation of a scalar, 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 scalar 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 scalar (or -1 if reading failed) and outputs the read scalar. 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 scalar (or -1 if reading failed) and outputs the read scalar. 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 scalar (or -1 if reading failed) and outputs the read scalar. More... | |
void | Copy (string str) |
Parses a scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar. More... | |
bool | TryCopy (string str) |
Parses a scalar from a string and sets the value to the parsed scalar. 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 (Scalar a, ref Scalar res) |
Copies a scalar to another (existing) scalar in place. More... | |
static void | Copy (double a, ref Scalar res) |
Copies a number to an (existing) scalar in place. More... | |
static Scalar | NaN () |
Creates a scalar that is not a number. More... | |
static Scalar | PositiveInfinity () |
Creates a scalar that represents positive infinity. More... | |
static Scalar | NegativeInfinity () |
Creates a scalar that represents negative infinity. More... | |
static Scalar | MinValue () |
Creates a scalar that contains minimal representable value. More... | |
static Scalar | MaxValue () |
Creates a scalar that contains maximal representable value. More... | |
static Scalar | Epsilon () |
Creates a scalar that contains the smallest positive value greater than 0. More... | |
static Scalar | operator+ (Scalar s) |
static Scalar | operator- (Scalar s) |
static Scalar | operator+ (Scalar a, Scalar b) |
static Scalar | operator- (Scalar a, Scalar b) |
static Scalar | operator* (Scalar a, Scalar b) |
static Scalar | operator/ (Scalar a, Scalar b) |
static bool | operator== (Scalar a, Scalar b) |
static bool | operator!= (Scalar a, Scalar b) |
static bool | operator< (Scalar a, Scalar b) |
static bool | operator> (Scalar a, Scalar b) |
static bool | operator<= (Scalar a, Scalar b) |
static bool | operator>= (Scalar a, Scalar b) |
static implicit | operator double (Scalar a) |
Implicit conversion from Scalar to double. More... | |
static implicit | operator Scalar (double a) |
Implicit conversion from double to Scalar. More... | |
static int | Read (ref Scalar result, string str) |
Reads a scalar from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar. More... | |
static int | Read (ref Scalar result, string str, int startpos) |
Reads a scalar from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar. More... | |
static int | Read (ref Scalar result, string str, int startpos, bool skipspaces) |
Reads a scalar from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar. More... | |
static Scalar | Parse (string str) |
Parses a scalar 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 scalar. More... | |
static bool | TryParse (string str, ref Scalar result) |
Parses a scalar 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 Scalar class More... | |
Public Attributes | |
double | Value |
Value of the scalar. More... | |
Properties | |
static Scalar | One [get] |
Returns a scalar with value 1. More... | |
static Scalar | Zero [get] |
Returns a scalar with value 0. More... | |
bool | IsNaN [get] |
Indicates whether the current Scalar is not a number. More... | |
bool | IsPositiveInfinity [get] |
Indicates whether the current Scalar represents positive infinity. More... | |
bool | IsNegativeInfinity [get] |
Indicates whether the current Scalar represents negative infinity. More... | |
bool | IsInfinity [get] |
Indicates whether the current Scalar represents infinity. More... | |
Represents a real number.
|
inline |
References IG.Num.Scalar.Value.
|
inline |
|
inline |
Copies a scalar to the current scalar.
References IG.Num.Scalar.Value.
|
inline |
Copies double to the current scalar.
Copies a scalar to another (existing) scalar in place.
References IG.Num.Scalar.Value.
|
inlinestatic |
Copies a number to an (existing) scalar in place.
a | Number that is copied. |
res | Scalar where result is stored. |
|
inlinestatic |
Creates a scalar that is not a number.
|
inlinestatic |
Creates a scalar that represents positive infinity.
|
inlinestatic |
Creates a scalar that represents negative infinity.
|
inlinestatic |
Creates a scalar that contains minimal representable value.
|
inlinestatic |
Creates a scalar that contains maximal representable value.
|
inlinestatic |
Creates a scalar that contains the smallest positive value greater than 0.
References IG.Num.Scalar.Value.
|
inline |
Indicates whether obj
is equal to this instance.
|
inline |
Indicates whether a
is equal to this instance.
References IG.Num.Scalar.IsNaN, and IG.Num.Scalar.Value.
|
inline |
Gets the hashcode of this Scalar
.
|
inline |
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
References IG.Num.Scalar.Value.
|
inlinestatic |
Implicit conversion from Scalar to double.
References IG.Num.Scalar.Value.
|
inlinestatic |
Implicit conversion from double to Scalar.
|
inline |
Returns standard string representation of a scalar, with decimal point and e for exponent, no 1000 separators, number of digits according to type accuracy.
Referenced by IG.Num.Scalar.Examples().
|
inline |
Returns a string representation of a scalar in the specified way.
format | the format string. |
formatProvider | The bormat provider used. |
|
inlinestatic |
Reads a scalar from a string, starting at the beginning and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
result | Output parameter returning the scalar that was read. |
str | String from which the scalar is read. |
|
inlinestatic |
Reads a scalar from a string, starting at a specified position and skipping any leading spaces. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
result | Output parameter returning the scalar that was read. |
str | String from which the scalar is read. |
startpos | Starting position from which scalar is searched for. |
|
inlinestatic |
Reads a scalar from a string, starting at a specified position. Returns the position of the first character after the read scalar (or -1 if reading failed) and outputs the read scalar.
result | Output parameter returning the scalar that was read. |
str | String from which the scalar is read. |
startpos | Starting position from which scalar 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.ReadNumber().
|
inlinestatic |
Parses a scalar 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 scalar.
str | String that is parsed. |
References IG.Num.s, and IG.Lib.Parser.SkipSpaces().
|
inlinestatic |
Parses a scalar 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 of the operation 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 scalar (or -1 if reading failed) and outputs the read scalar.
str | String from which the scalar 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 scalar (or -1 if reading failed) and outputs the read scalar.
str | String from which the scalar is read. |
startpos | Starting position from which scalar 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 scalar (or -1 if reading failed) and outputs the read scalar.
str | String from which the scalar is read. |
startpos | Starting position from which scalar 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 scalar from a string and sets the value to the parsed scalar. Leading and trailing spaces are ignored, but other characters are not. FormatException is thrown if the string does not represent a scalar.
str | String that is parsed. |
References IG.Num.s.
|
inline |
Parses a scalar from a string and sets the value to the parsed scalar. 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 Scalar class
References IG.Num.Scalar.ToString().
double IG.Num.Scalar.Value |
Value of the scalar.
Referenced by IG.Num.Scalar.Compare(), IG.Num.Scalar.Copy(), IG.Num.Scalar.Equals(), IG.Num.Scalar.operator double(), IG.Num.Scalar.operator!=(), IG.Num.Scalar.operator*(), IG.Num.Scalar.operator+(), IG.Num.Scalar.operator-(), IG.Num.Scalar.operator/(), IG.Num.Scalar.operator<(), IG.Num.Scalar.operator<=(), IG.Num.Scalar.operator==(), IG.Num.Scalar.operator>(), IG.Num.Scalar.operator>=(), and IG.Num.Scalar.Scalar().
|
staticget |
Returns a scalar with value 1.
|
staticget |
Returns a scalar with value 0.
|
get |
Indicates whether the current Scalar
is not a number.
Referenced by IG.Num.Scalar.Equals().
|
get |
Indicates whether the current Scalar
represents positive infinity.
|
get |
Indicates whether the current Scalar
represents negative infinity.
|
get |
Indicates whether the current Scalar
represents infinity.