Table of Contents

Struct QuantityInc

Namespace
Cryville.Measure
Assembly
Cryville.Measure.dll
Quantity with implied uncertainty.
public readonly record struct QuantityInc : IInterval, IComparable<QuantityInc>, IEquatable<QuantityInc>
Implements
Inherited Members

Constructors

QuantityInc(double, Unit)

Creates an instance of the QuantityInc struct.
public QuantityInc(double value, Unit unit)

Parameters

value double
The value.
unit Unit
The unit.

QuantityInc(double, double, Unit)

Quantity with implied uncertainty.
public QuantityInc(double Value, double Uncertainty, Unit Unit)

Parameters

Value double
The value.
Uncertainty double
The uncertainty.
Unit Unit
The unit.

QuantityInc(float, Unit)

Creates an instance of the QuantityInc struct.
public QuantityInc(float value, Unit unit)

Parameters

value float
The value.
unit Unit
The unit.

QuantityInc(float, float, Unit)

Creates an instance of the QuantityInc struct.
public QuantityInc(float value, float uncertainty, Unit unit)

Parameters

value float
The value.
uncertainty float
The lower and upper uncertainty.
unit Unit
The unit.

Properties

MaxValue

The maximum value.
public Quantity MaxValue { get; }

Property Value

Quantity

MinValue

The minimum value.
public Quantity MinValue { get; }

Property Value

Quantity

Uncertainty

The uncertainty.
public double Uncertainty { get; init; }

Property Value

double

Unit

The unit.
public Unit Unit { get; init; }

Property Value

Unit

Value

The value.
public double Value { get; init; }

Property Value

double

Methods

CompareTo(QuantityInc)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(QuantityInc other)

Parameters

other QuantityInc
An object to compare with this instance.

Returns

int
A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes other in the sort order. Zero This instance occurs in the same position in the sort order as other. Greater than zero This instance follows other in the sort order.

Equals(QuantityInc)

Indicates whether the current object is equal to another object of the same type.
public bool Equals(QuantityInc other)

Parameters

other QuantityInc
An object to compare with this object.

Returns

bool
true if the current object is equal to the other parameter; otherwise, false.

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.

To(Unit)

Converts the current quantity to a quantity with the specified unit.
public QuantityInc To(Unit unit)

Parameters

unit Unit
The target unit.

Returns

QuantityInc
A new quantity converted to unit.

Exceptions

InvalidOperationException
The target unit has a different dimension from the current quantity's unit.

ToString()

Returns the fully qualified type name of this instance.
public override string ToString()

Returns

string
The fully qualified type name.

Operators

operator >(QuantityInc, QuantityInc)

public static bool operator >(QuantityInc left, QuantityInc right)

Parameters

left QuantityInc
right QuantityInc

Returns

bool

operator >=(QuantityInc, QuantityInc)

public static bool operator >=(QuantityInc left, QuantityInc right)

Parameters

left QuantityInc
right QuantityInc

Returns

bool

operator <(QuantityInc, QuantityInc)

public static bool operator <(QuantityInc left, QuantityInc right)

Parameters

left QuantityInc
right QuantityInc

Returns

bool

operator <=(QuantityInc, QuantityInc)

public static bool operator <=(QuantityInc left, QuantityInc right)

Parameters

left QuantityInc
right QuantityInc

Returns

bool