Record TQuantity

Unit

Declaration

type TQuantity = record

Description

Represents a physical quantity with dimension checking at runtime.

Combines a double value with a TDimension, ensuring that arithmetic operations are dimensionally consistent. Incompatible dimensions raise an exception at runtime. When the symbol ADIMOFF is defined, this type degenerates to double and all dimension checking is disabled.

Overview

Methods

Public function Reciprocal: TQuantity;
Public class operator *(const ALeft: double; const ARight: TQuantity): TQuantity;
Public class operator *(const ALeft: TQuantity; const ARight: double): TQuantity;
Public class operator *(const ALeft, ARight: TQuantity): TQuantity;
Public class operator +(const ASelf: TQuantity): TQuantity;
Public class operator +(const ALeft, ARight: TQuantity): TQuantity;
Public class operator -(const ASelf: TQuantity): TQuantity;
Public class operator -(const ALeft, ARight: TQuantity): TQuantity;
Public class operator /(const ALeft: double; const ARight: TQuantity): TQuantity;
Public class operator /(const ALeft: TQuantity; const ARight: double): TQuantity;
Public class operator /(const ALeft, ARight: TQuantity): TQuantity;
Public class operator :=(const AValue: double): TQuantity;
Public class operator <>(const ALeft, ARight: TQuantity): boolean;
Public class operator <(const ALeft, ARight: TQuantity): boolean;
Public class operator <=(const ALeft, ARight: TQuantity): boolean;
Public class operator =(const ALeft, ARight: TQuantity): boolean;
Public class operator >(const ALeft, ARight: TQuantity): boolean;
Public class operator >=(const ALeft, ARight: TQuantity): boolean;

Description

Methods

Public function Reciprocal: TQuantity;

Returns the reciprocal of the quantity: 1 / self. The resulting dimension is the inverse of the original dimension.

Public class operator *(const ALeft: double; const ARight: TQuantity): TQuantity;

Returns the product of a dimensionless real scalar and a quantity. The dimension is preserved.

Public class operator *(const ALeft: TQuantity; const ARight: double): TQuantity;

Returns the product of a quantity and a dimensionless real scalar. The dimension is preserved.

Public class operator *(const ALeft, ARight: TQuantity): TQuantity;

Returns the product of two quantities. The resulting dimension is the product of the two dimensions.

Public class operator +(const ASelf: TQuantity): TQuantity;

Unary plus. Returns the quantity unchanged.

Public class operator +(const ALeft, ARight: TQuantity): TQuantity;

Returns the sum of two quantities. Both operands must have the same dimension.

Public class operator -(const ASelf: TQuantity): TQuantity;

Unary minus. Returns the negation of the quantity.

Public class operator -(const ALeft, ARight: TQuantity): TQuantity;

Returns the difference of two quantities. Both operands must have the same dimension.

Public class operator /(const ALeft: double; const ARight: TQuantity): TQuantity;

Returns the quotient of a dimensionless real scalar divided by a quantity. The resulting dimension is the inverse of ARight.

Public class operator /(const ALeft: TQuantity; const ARight: double): TQuantity;

Returns the quotient of a quantity divided by a dimensionless real scalar. The dimension is preserved.

Public class operator /(const ALeft, ARight: TQuantity): TQuantity;

Returns the quotient of two quantities. The resulting dimension is the ratio of the two dimensions.

Public class operator :=(const AValue: double): TQuantity;

Implicit conversion from a dimensionless real value to a TQuantity. The resulting quantity has a scalar (dimensionless) dimension.

Public class operator <>(const ALeft, ARight: TQuantity): boolean;

Returns True if the operands differ in dimension or in value.

Public class operator <(const ALeft, ARight: TQuantity): boolean;

Returns True if ALeft is dimensionally compatible with ARight and its value is strictly less.

Public class operator <=(const ALeft, ARight: TQuantity): boolean;

Returns True if ALeft is dimensionally compatible with ARight and its value is less than or equal.

Public class operator =(const ALeft, ARight: TQuantity): boolean;

Returns True if both operands have the same dimension and equal values.

Public class operator >(const ALeft, ARight: TQuantity): boolean;

Returns True if ALeft is dimensionally compatible with ARight and its value is strictly greater.

Public class operator >=(const ALeft, ARight: TQuantity): boolean;

Returns True if ALeft is dimensionally compatible with ARight and its value is greater than or equal.


Generated by PasDoc 1.0.4.