Table of Contents

Struct QuantityUnc

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

Constructors

QuantityUnc(double, double, Unit)

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

Parameters

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

QuantityUnc(double, double, double, Unit)

Quantity with uncertainty.
public QuantityUnc(double Value, double LowerUncertainty, double UpperUncertainty, Unit Unit)

Parameters

Value double
The value.
LowerUncertainty double
The lower uncertainty.
UpperUncertainty double
The upper uncertainty.
Unit Unit
The unit.

QuantityUnc(float, float, Unit)

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

Parameters

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

QuantityUnc(float, float, float, Unit)

Creates an instance of the QuantityUnc struct.
public QuantityUnc(float value, float lowerUncertainty, float upperUncertainty, Unit unit)

Parameters

value float
The value.
lowerUncertainty float
The lower uncertainty.
upperUncertainty float
The upper uncertainty.
unit Unit
The unit.

Properties

LowerUncertainty

The lower uncertainty.
public double LowerUncertainty { get; init; }

Property Value

double

MaxValue

The maximum value.
public Quantity MaxValue { get; }

Property Value

Quantity

MinValue

The minimum value.
public Quantity MinValue { get; }

Property Value

Quantity

Unit

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

Property Value

Unit

UpperUncertainty

The upper uncertainty.
public double UpperUncertainty { get; init; }

Property Value

double

Value

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

Property Value

double

Methods

CompareTo(QuantityUnc)

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(QuantityUnc other)

Parameters

other QuantityUnc
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(QuantityUnc)

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

Parameters

other QuantityUnc
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 QuantityUnc To(Unit unit)

Parameters

unit Unit
The target unit.

Returns

QuantityUnc
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 >(QuantityUnc, QuantityUnc)

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

Parameters

left QuantityUnc
right QuantityUnc

Returns

bool

operator >=(QuantityUnc, QuantityUnc)

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

Parameters

left QuantityUnc
right QuantityUnc

Returns

bool

operator <(QuantityUnc, QuantityUnc)

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

Parameters

left QuantityUnc
right QuantityUnc

Returns

bool

operator <=(QuantityUnc, QuantityUnc)

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

Parameters

left QuantityUnc
right QuantityUnc

Returns

bool