MarketFactory C# API 3.0
MFFloat Struct Reference

A thin wrapper for a fixed-precision floating point number. More...

Inheritance diagram for MFFloat:

Public Member Functions

 MFFloat (string svalue)
 Constructor which accepts a string value. More...
 
 MFFloat (long value)
 Constructor which accepts a raw long value (integer offset by 10^9). More...
 
MFFloat add (MFFloat o)
 Addition operator. More...
 
int CompareTo (Object o)
 Implements Comparable method compareTo. More...
 
override bool Equals (System.Object obj)
 
int fpart ()
 Return the fractional portion of the numerical value, as an integer which represents the number of billion'ths, without the sign. More...
 
override int GetHashCode ()
 
bool gt (MFFloat o)
 Comparison operator: greater-than. More...
 
bool gte (MFFloat o)
 Comparison operator: greater-than or equal. More...
 
long ipart ()
 Return the integer portion of the numerical value. More...
 
bool lt (MFFloat o)
 Comparison operator: less-than. More...
 
bool lte (MFFloat o)
 Comparison operator: less-than or equal. More...
 
MFFloat sub (MFFloat o)
 Subtraction operator. More...
 
double toDouble ()
 Convert the value to a double. More...
 
long toLong ()
 Provide access to the raw long value. More...
 
override string ToString ()
 Convert the value to a human-readable string. More...
 

Static Public Member Functions

static bool isValid (MFFloat o)
 Check if MFFloat object has valid value. More...
 
static long longValueOf (string s)
 Returns a long value for the given string representation of a FP number. More...
 
static bool operator!= (MFFloat c1, MFFloat? c2)
 
static bool operator== (MFFloat c1, MFFloat? c2)
 
static MFFloat valueOf (string s)
 Returns a MFFloat object for the given string representation of a FP number. More...
 
static MFFloat valueOf (double d, int precision)
 Returns a MFFloat object for the given string representation of a FP number. More...
 

Static Public Attributes

static MFFloat NA = new MFFloat(-9223372036854775805L)
 Special value: Not Applicable. More...
 
static MFFloat NDA = new MFFloat(-9223372036854775806L)
 Special value: No Data Available. More...
 
static MFFloat NMA = new MFFloat(-9223372036854775807L)
 Special value: No Market Available. More...
 
static readonly MFFloat NULL
 
static MFFloat ZERO = new MFFloat(0)
 Special value: Zero (as a convenience). More...
 

Properties

bool HasValue [get]
 

Detailed Description

A thin wrapper for a fixed-precision floating point number.

This class is immutable, you may not change the contents of the object. (All operations on it create a new object.)

Constructor & Destructor Documentation

◆ MFFloat() [1/2]

MFFloat ( string  svalue)

Constructor which accepts a string value.

◆ MFFloat() [2/2]

MFFloat ( long  value)

Constructor which accepts a raw long value (integer offset by 10^9).

Member Function Documentation

◆ longValueOf()

static long longValueOf ( string  s)
static

Returns a long value for the given string representation of a FP number.

This will throw an exception is the format is invalid.

◆ valueOf() [1/2]

static MFFloat valueOf ( string  s)
static

Returns a MFFloat object for the given string representation of a FP number.

◆ valueOf() [2/2]

static MFFloat valueOf ( double  d,
int  precision 
)
static

Returns a MFFloat object for the given string representation of a FP number.

◆ toLong()

long toLong ( )

Provide access to the raw long value.

◆ toDouble()

double toDouble ( )

Convert the value to a double.

(Don't use this if you care about precision.)

◆ ipart()

long ipart ( )

Return the integer portion of the numerical value.

◆ fpart()

int fpart ( )

Return the fractional portion of the numerical value, as an integer which represents the number of billion'ths, without the sign.

◆ ToString()

override string ToString ( )

Convert the value to a human-readable string.

◆ Equals()

override bool Equals ( System.Object  obj)

◆ operator==()

static bool operator== ( MFFloat  c1,
MFFloat c2 
)
static

◆ operator!=()

static bool operator!= ( MFFloat  c1,
MFFloat c2 
)
static

◆ GetHashCode()

override int GetHashCode ( )

◆ lte()

bool lte ( MFFloat  o)

Comparison operator: less-than or equal.

◆ gte()

bool gte ( MFFloat  o)

Comparison operator: greater-than or equal.

◆ lt()

bool lt ( MFFloat  o)

Comparison operator: less-than.

◆ gt()

bool gt ( MFFloat  o)

Comparison operator: greater-than.

◆ add()

MFFloat add ( MFFloat  o)

Addition operator.

Will throw an exception if either of the objects is not valid.

◆ sub()

MFFloat sub ( MFFloat  o)

Subtraction operator.

Will throw an exception if either of the objects is not valid.

◆ CompareTo()

int CompareTo ( Object  o)

Implements Comparable method compareTo.

◆ isValid()

static bool isValid ( MFFloat  o)
static

Check if MFFloat object has valid value.

Member Data Documentation

◆ NULL

readonly MFFloat NULL
static

◆ NMA

MFFloat NMA = new MFFloat(-9223372036854775807L)
static

Special value: No Market Available.

◆ NDA

MFFloat NDA = new MFFloat(-9223372036854775806L)
static

Special value: No Data Available.

◆ NA

MFFloat NA = new MFFloat(-9223372036854775805L)
static

Special value: Not Applicable.

◆ ZERO

MFFloat ZERO = new MFFloat(0)
static

Special value: Zero (as a convenience).

Property Documentation

◆ HasValue

bool HasValue
get
Confidential. Copyright © 2011 MarketFactory, Inc.