2011-11-07 01:29:50 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* Single.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX Single structure definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _SYSTEM_SINGLE_
|
|
|
|
|
#define _SYSTEM_SINGLE_
|
|
|
|
|
|
|
|
|
|
#include <System/Interfaces.h>
|
|
|
|
|
#include <System/Object.h>
|
|
|
|
|
|
|
|
|
|
namespace System
|
|
|
|
|
{
|
|
|
|
|
// Represents a single precision floating point value.
|
|
|
|
|
struct Single : public IComparable<Single>, public IEquatable<Single>, virtual Object
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
float value;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static const float Epsilon;
|
|
|
|
|
static const float MaxValue;
|
|
|
|
|
static const float MinValue;
|
|
|
|
|
static const float NaN;
|
|
|
|
|
static const float NegativeInfinity;
|
|
|
|
|
static const float PositiveInfinity;
|
|
|
|
|
|
2012-03-29 22:02:43 +00:00
|
|
|
|
Single(const Single &obj);
|
|
|
|
|
Single(const float &obj);
|
2011-11-07 01:29:50 +00:00
|
|
|
|
|
2012-03-29 22:02:43 +00:00
|
|
|
|
int CompareTo(const Single other) const;
|
|
|
|
|
bool Equals(const Single other) const;
|
|
|
|
|
int GetHashCode() const;
|
2012-09-28 20:36:02 +00:00
|
|
|
|
int GetType() const;
|
2011-11-07 01:29:50 +00:00
|
|
|
|
static float Parse(char* str);
|
2012-03-29 22:02:43 +00:00
|
|
|
|
const char* ToString() const;
|
2011-11-07 01:29:50 +00:00
|
|
|
|
|
2012-09-28 20:36:02 +00:00
|
|
|
|
bool operator !=(const float right) const;
|
2012-03-29 22:02:43 +00:00
|
|
|
|
bool operator !=(const Single right) const;
|
2012-09-28 20:36:02 +00:00
|
|
|
|
bool operator ==(const float right) const;
|
2012-03-29 22:02:43 +00:00
|
|
|
|
bool operator ==(const Single right) const;
|
2011-11-07 01:29:50 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_SYSTEM_SINGLE_
|