Struct FixedPoint32
Represents a signed 16.16 fixed-point number.
public readonly struct FixedPoint32 : IEquatable<FixedPoint32>
- Implements
- Inherited Members
Constructors
FixedPoint32(double)
Converts a double-precision value to 16.16 fixed point.
public FixedPoint32(double val)
Parameters
valdoubleThe value to convert.
FixedPoint32(int)
Represents a signed 16.16 fixed-point number.
public FixedPoint32(int _rawValue)
Parameters
_rawValueintThe raw fixed-point representation.
FixedPoint32(float)
Converts a single-precision value to 16.16 fixed point.
public FixedPoint32(float val)
Parameters
valfloatThe value to convert.
Properties
RawValue
Gets the raw 16.16 representation.
public int RawValue { get; }
Property Value
Value
Gets the represented single-precision value.
public float Value { get; }
Property Value
Methods
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(FixedPoint32)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(FixedPoint32 other)
Parameters
otherFixedPoint32An object to compare with this object.
Returns
FromJsonString(string)
Deserializes a raw 16.16 fixed-point value from JSON.
public static FixedPoint32 FromJsonString(string jsonString)
Parameters
jsonStringstringThe JSON number to deserialize.
Returns
- FixedPoint32
The deserialized value.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToJsonString()
Serializes the raw fixed-point value to JSON.
public string ToJsonString()
Returns
- string
The serialized raw value.
ToString()
Formats the represented value using the invariant culture.
public override string ToString()
Returns
- string
The decimal representation.
Operators
operator ==(FixedPoint32, FixedPoint32)
Determines whether two fixed-point values are equal.
public static bool operator ==(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32
Returns
operator >(FixedPoint32, FixedPoint32)
Determines whether the left value is greater than the right value.
public static bool operator >(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32
Returns
operator >=(FixedPoint32, FixedPoint32)
Determines whether the left value is greater than or equal to the right value.
public static bool operator >=(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32
Returns
operator !=(FixedPoint32, FixedPoint32)
Determines whether two fixed-point values are not equal.
public static bool operator !=(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32
Returns
operator <(FixedPoint32, FixedPoint32)
Determines whether the left value is less than the right value.
public static bool operator <(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32
Returns
operator <=(FixedPoint32, FixedPoint32)
Determines whether the left value is less than or equal to the right value.
public static bool operator <=(FixedPoint32 lhs, FixedPoint32 rhs)
Parameters
lhsFixedPoint32rhsFixedPoint32