Add unary - operator for nullable powers
This commit is contained in:
parent
2ace3fad51
commit
f8b1d70f79
|
@ -12,6 +12,6 @@ public sealed class ActivePower : AcPower
|
||||||
public static implicit operator ActivePower(Double d) => new ActivePower(d);
|
public static implicit operator ActivePower(Double d) => new ActivePower(d);
|
||||||
public static implicit operator Double(ActivePower d) => d.Value;
|
public static implicit operator Double(ActivePower d) => d.Value;
|
||||||
|
|
||||||
public static ActivePower operator -(ActivePower d) => -d.Value;
|
public static ActivePower? operator -(ActivePower? d) => -d?.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,7 @@ public sealed class ReactivePower : AcPower
|
||||||
|
|
||||||
public static implicit operator ReactivePower(Double d) => new ReactivePower(d);
|
public static implicit operator ReactivePower(Double d) => new ReactivePower(d);
|
||||||
public static implicit operator Double(ReactivePower d) => d.Value;
|
public static implicit operator Double(ReactivePower d) => d.Value;
|
||||||
|
|
||||||
|
public static ReactivePower? operator -(ReactivePower? d) => -d?.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue