Innovenergy_trunk/csharp/Lib/Units/Frequency.cs

15 lines
451 B
C#
Raw Normal View History

namespace InnovEnergy.Lib.Units;
2023-06-13 11:03:49 +00:00
public sealed class Frequency : Unit
{
2023-06-13 11:03:49 +00:00
public override String Symbol => "Hz";
2023-06-13 11:03:49 +00:00
public Frequency(Double value) : base(value)
2023-02-26 18:19:16 +00:00
{
if (value < 0)
throw new ArgumentException(nameof(Frequency) + " cannot be negative", nameof(value));
}
2023-06-13 11:03:49 +00:00
public static implicit operator Frequency(Double d) => new Frequency(d);
public static implicit operator Double(Frequency d) => d.Value;
}