PowerMultiple
References[IoId("00000000-AE93-48D3-8C0B-0D2EA0ADE15A")]
public struct PowerMultiple : IComparable<PowerMultiple>, IStorable
Represents an immutable number defined as the multiple of some power.
Constructors
Properties
Methods
DecimalPart
#Return the decimal part of this number. This is basically the number minus the nearest smaller integer.
Expand
#Decrease the exponent and raise the coefficient of this number without changing its magnitude.
Returns: Expanded number.
FromFloatingPoint
#Convert a floating point value into a power multiple.
Returns: Power multiple representing the floating point number.
FromFloatingPoint
#Convert a floating point value into a power multiple base 10.
Returns: Power multiple representing the floating point number.
Rebase
#Rebase this number. Note that this method will return approximate values under certain conditions.
Returns: Rebased number.
Round
#Round this number down to a fixed number of significant coefficient digits. Rounding is only exact if the Radix equals 10, otherwise some inaccuracies will be introduced.
Returns: Rounded number.
ToDouble
#Gets the double representation for this power multiple. Note that very large and very small powers fall outside the double numeric range.
Returns: Double representation of power multiple.
ToInteger
#Gets the integer representation for this power multiple. If this multiple cannot be represented by an exact integer, an approximate value is returned.
Returns: Integer representation of power multiple.
ToString
#Returns a string that represents the current value.
Returns: A string that represents the current object.
Overrides: ValueType.ToString
ToString
#Returns a string that represents the current value.
public string ToString()
integerFormat,
Formatter to use for integers.
doubleFormat
Formatter to use for non-integers.
Returns: A string that represents the current object.
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| PowerMultiple | + | PowerMultiple | PowerMultiple | Add two power multiples together. Multiples must share the same radix. |
| PowerMultiple | / | PowerMultiple | PowerMultiple | Multiply two power multiples together. Multiples must share the same radix. |
| PowerMultiple | > | PowerMultiple | bool | Compare two numbers for less-than. |
| PowerMultiple | < | PowerMultiple | bool | Compare two numbers for less-than. |
| PowerMultiple | * | PowerMultiple | PowerMultiple | Multiply two power multiples together. Multiples must share the same radix. |
| PowerMultiple | - | PowerMultiple | PowerMultiple | Subtract two power multiples. Multiples must share the same radix. |
| - | PowerMultiple | PowerMultiple | Create the negative of a power multiple. | |
| + | PowerMultiple | PowerMultiple | Positive indicator. This operator does nothing. | |
Convertors
| Operation | Result | Description | ||
|---|---|---|---|---|
| implicit | BigInteger | PowerMultiple | Convert a big integer into a power multiple. | |
| implicit | double | PowerMultiple | Convert a double precision floating point number into a power multiple. This automatic converter assumes six decimal places of accuracy, if you want custom control over the accuracy, use the FromFloatingPoint() method. | |
| implicit | int | PowerMultiple | Convert an integer into a power multiple. | |
| implicit | long | PowerMultiple | Convert a long integer into a power multiple. | |