Voltage Structure

Represents an electromotive force (i.e., voltage) measurement, in volts, as a double-precision floating-point number.

Definition

Namespace: Gemstone.Units
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
[SerializableAttribute]
public struct Voltage : IComparable, IFormattable, 
	IConvertible, IComparable<Voltage>, IComparable<double>, IEquatable<Voltage>, 
	IEquatable<double>
Inheritance
Object    ValueType    Voltage
Implements
IComparable, IComparableVoltage, IComparableDouble, IConvertible, IEquatableVoltage, IEquatableDouble, IFormattable

Remarks

This class behaves just like a Double representing a voltage in volts; it is implicitly castable to and from a Double and therefore can be generally used "as" a double, but it has the advantage of handling conversions to and from other voltage representations, specifically abvolt and statvolt. Metric conversions are handled simply by applying the needed SI conversion factor, for example:

Example

Convert volts to megavolts:
C#
public double GetMegavolts(Voltage volts)
{
    return volts / SI.Mega;
}

Constructors

Voltage Creates a new Voltage.

Methods

CompareTo(Double) Compares this instance to a specified Double and returns an indication of their relative values.
CompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
CompareTo(Voltage) Compares this instance to a specified Voltage and returns an indication of their relative values.
ConvertFrom Converts the value in the specified sourceUnit to a new Voltage in volts.
ConvertTo Converts the Voltage to the specified targetUnit.
Equals(Double) Returns a value indicating whether this instance is equal to a specified Double value.
Equals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Equals(Voltage) Returns a value indicating whether this instance is equal to a specified Voltage value.
FromAbvolts Creates a new Voltage value from the specified value in abvolts.
FromStatvolts Creates a new Voltage value from the specified value in statvolts.
GetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetTypeCode Returns the TypeCode for value type Double.
Parse(String) Converts the string representation of a number to its Voltage equivalent.
Parse(String, NumberStyles) Converts the string representation of a number in a specified style to its Voltage equivalent.
Parse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its Voltage equivalent.
Parse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its Voltage equivalent.
ToAbvolts Gets the Voltage value in abvolts.
ToStatvolts Gets the Voltage value in statvolts.
ToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
ToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
ToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
ToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
TryParse(String, Voltage) Converts the string representation of a number to its Voltage equivalent. A return value indicates whether the conversion succeeded or failed.
TryParse(String, NumberStyles, IFormatProvider, Voltage) Converts the string representation of a number in a specified style and culture-specific format to its Voltage equivalent. A return value indicates whether the conversion succeeded or failed.

Operators

Addition(Voltage, Voltage) Returns computed sum of values.
Division(Voltage, Voltage) Returns computed division of values.
Equality(Voltage, Voltage) Compares the two values for equality.
Exponent(Voltage, Voltage) Returns result of first value raised to voltage of second value.
GreaterThan(Voltage, Voltage) Returns true if left value is greater than right value.
GreaterThanOrEqual(Voltage, Voltage) Returns true if left value is greater than or equal to right value.
(Double to Voltage) Implicitly converts value, represented in volts, to a Voltage.
(Voltage to Double) Implicitly converts Voltage, represented in volts, to a Double.
Inequality(Voltage, Voltage) Compares the two values for inequality.
LessThan(Voltage, Voltage) Returns true if left value is less than right value.
LessThanOrEqual(Voltage, Voltage) Returns true if left value is less or equal to than right value.
Modulus(Voltage, Voltage) Returns computed remainder after dividing first value by the second.
Multiply(Voltage, Voltage) Returns computed product of values.
Subtraction(Voltage, Voltage) Returns computed difference of values.

Fields

MaxValueRepresents the largest possible value of an Voltage. This field is constant.
MinValueRepresents the smallest possible value of an Voltage. This field is constant.

Extension Methods

GetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
GetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)

See Also