Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AbsorbedDose<T> operator +(AbsorbedDose<T> left, AbsorbedDose<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="AbsorbedDose{T}"/>.</summary>
/// <summary>Scales a <see cref="AbsorbedDose{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AbsorbedDose<T> operator -(AbsorbedDose<T> value) => Create(-value.Quantity);
public static AbsorbedDose<T> operator *(AbsorbedDose<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="AbsorbedDose{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="AbsorbedDose{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AbsorbedDose<T> operator *(AbsorbedDose<T> left, T right) => Create(left.Quantity * right);
public static AbsorbedDose<T> operator *(T left, AbsorbedDose<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="AbsorbedDose{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="AbsorbedDose{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AbsorbedDose<T> operator *(T left, AbsorbedDose<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="AbsorbedDose{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AbsorbedDose<T> operator /(AbsorbedDose<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static AbsorbedDose<T> operator /(AbsorbedDose<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="AbsorbedDose{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AccelerationMagnitude<T> operator +(AccelerationMagnitude<T> left, AccelerationMagnitude<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="AccelerationMagnitude{T}"/>.</summary>
/// <summary>Scales a <see cref="AccelerationMagnitude{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AccelerationMagnitude<T> operator -(AccelerationMagnitude<T> value) => Create(-value.Quantity);
public static AccelerationMagnitude<T> operator *(AccelerationMagnitude<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="AccelerationMagnitude{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="AccelerationMagnitude{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AccelerationMagnitude<T> operator *(AccelerationMagnitude<T> left, T right) => Create(left.Quantity * right);
public static AccelerationMagnitude<T> operator *(T left, AccelerationMagnitude<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="AccelerationMagnitude{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="AccelerationMagnitude{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AccelerationMagnitude<T> operator *(T left, AccelerationMagnitude<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="AccelerationMagnitude{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AccelerationMagnitude<T> operator /(AccelerationMagnitude<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static AccelerationMagnitude<T> operator /(AccelerationMagnitude<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="AccelerationMagnitude{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AcousticImpedance<T> operator +(AcousticImpedance<T> left, AcousticImpedance<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="AcousticImpedance{T}"/>.</summary>
/// <summary>Scales a <see cref="AcousticImpedance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AcousticImpedance<T> operator -(AcousticImpedance<T> value) => Create(-value.Quantity);
public static AcousticImpedance<T> operator *(AcousticImpedance<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="AcousticImpedance{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="AcousticImpedance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AcousticImpedance<T> operator *(AcousticImpedance<T> left, T right) => Create(left.Quantity * right);
public static AcousticImpedance<T> operator *(T left, AcousticImpedance<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="AcousticImpedance{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="AcousticImpedance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AcousticImpedance<T> operator *(T left, AcousticImpedance<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="AcousticImpedance{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static AcousticImpedance<T> operator /(AcousticImpedance<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static AcousticImpedance<T> operator /(AcousticImpedance<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="AcousticImpedance{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static ActivationEnergy<T> operator +(ActivationEnergy<T> left, ActivationEnergy<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="ActivationEnergy{T}"/>.</summary>
/// <summary>Scales a <see cref="ActivationEnergy{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static ActivationEnergy<T> operator -(ActivationEnergy<T> value) => Create(-value.Quantity);
public static ActivationEnergy<T> operator *(ActivationEnergy<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="ActivationEnergy{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="ActivationEnergy{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static ActivationEnergy<T> operator *(ActivationEnergy<T> left, T right) => Create(left.Quantity * right);
public static ActivationEnergy<T> operator *(T left, ActivationEnergy<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="ActivationEnergy{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="ActivationEnergy{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static ActivationEnergy<T> operator *(T left, ActivationEnergy<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="ActivationEnergy{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static ActivationEnergy<T> operator /(ActivationEnergy<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static ActivationEnergy<T> operator /(ActivationEnergy<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="ActivationEnergy{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Admittance<T> operator +(Admittance<T> left, Admittance<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="Admittance{T}"/>.</summary>
/// <summary>Scales a <see cref="Admittance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Admittance<T> operator -(Admittance<T> value) => Create(-value.Quantity);
public static Admittance<T> operator *(Admittance<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="Admittance{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="Admittance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Admittance<T> operator *(Admittance<T> left, T right) => Create(left.Quantity * right);
public static Admittance<T> operator *(T left, Admittance<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="Admittance{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="Admittance{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Admittance<T> operator *(T left, Admittance<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="Admittance{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Admittance<T> operator /(Admittance<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static Admittance<T> operator /(Admittance<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="Admittance{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,17 @@ namespace ktsu.Semantics.Quantities;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Airspeed<T> operator +(Airspeed<T> left, Airspeed<T> right) => Create(left.Quantity + right.Quantity);

/// <summary>Negates a <see cref="Airspeed{T}"/>.</summary>
/// <summary>Scales a <see cref="Airspeed{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Airspeed<T> operator -(Airspeed<T> value) => Create(-value.Quantity);
public static Airspeed<T> operator *(Airspeed<T> left, T right) => Create(Vector0Guards.EnsureNonNegative(left.Quantity * right, nameof(right)));

/// <summary>Scales a <see cref="Airspeed{T}"/> by a bare number.</summary>
/// <summary>Scales a <see cref="Airspeed{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Airspeed<T> operator *(Airspeed<T> left, T right) => Create(left.Quantity * right);
public static Airspeed<T> operator *(T left, Airspeed<T> right) => Create(Vector0Guards.EnsureNonNegative(left * right.Quantity, nameof(left)));

/// <summary>Scales a <see cref="Airspeed{T}"/> by a bare number.</summary>
/// <summary>Divides a <see cref="Airspeed{T}"/> by a bare number. Throws <see cref="System.ArgumentException"/> when the number is negative.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Airspeed<T> operator *(T left, Airspeed<T> right) => Create(left * right.Quantity);

/// <summary>Divides a <see cref="Airspeed{T}"/> by a bare number.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
public static Airspeed<T> operator /(Airspeed<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(left.Quantity / right);
public static Airspeed<T> operator /(Airspeed<T> left, T right) => T.IsZero(right) ? throw new System.DivideByZeroException("Cannot divide by zero.") : Create(Vector0Guards.EnsureNonNegative(left.Quantity / right, nameof(right)));

/// <summary>Divides one <see cref="Airspeed{T}"/> by another, giving the bare ratio.</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Physics quantity operator")]
Expand Down
Loading
Loading