Innovenergy_trunk/csharp/Lib/Units/Frequency.cs

19 lines
490 B
C#

using InnovEnergy.Lib.SrcGen;
using InnovEnergy.Lib.SrcGen.Attributes;
namespace InnovEnergy.Lib.Units;
[Generate<Operators>("HAS_CONSTRUCTOR")][Generate<Sum>]
public readonly partial struct Frequency
{
public static String Unit => "Hz";
public static String Symbol => "f";
public Frequency(Double value)
{
if (value < 0)
throw new ArgumentException(nameof(Frequency) + " cannot be negative", nameof(value));
Value = value;
}
}