Innovenergy_trunk/csharp/Lib/Time/Unix/UnixTimeSpan.Operators.cs

29 lines
1.9 KiB
C#
Raw Normal View History

namespace InnovEnergy.Lib.Time.Unix;
2023-02-16 12:57:06 +00:00
public readonly partial struct UnixTimeSpan
{
public static Boolean operator < (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks < r.Ticks;
public static Boolean operator > (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks > r.Ticks;
public static Boolean operator <= (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks <= r.Ticks;
public static Boolean operator >= (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks >= r.Ticks;
public static Boolean operator == (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks == r.Ticks;
public static Boolean operator != (UnixTimeSpan l, UnixTimeSpan r) => l.Ticks != r.Ticks;
public static UnixTimeSpan operator +(UnixTimeSpan a, UnixTimeSpan b) => new UnixTimeSpan(a.Ticks + b.Ticks);
public static UnixTimeSpan operator -(UnixTimeSpan a, UnixTimeSpan b) => new UnixTimeSpan(a.Ticks - b.Ticks);
public static UnixTimeSpan operator *(UnixTimeSpan a, UInt32 b) => new UnixTimeSpan(a.Ticks * b);
public static UnixTimeSpan operator *(UnixTimeSpan a, Int32 b) => new UnixTimeSpan(a.Ticks * (UInt32) b);
public static UnixTimeSpan operator *(UInt32 a, UnixTimeSpan b) => new UnixTimeSpan(a * b.Ticks);
public static UnixTimeSpan operator *(Int32 a, UnixTimeSpan b) => new UnixTimeSpan((UInt32) a * b.Ticks);
public static UnixTimeSpan operator /(UnixTimeSpan a, UInt32 b) => new UnixTimeSpan(a.Ticks / b);
public static UnixTimeSpan operator /(UnixTimeSpan a, Int32 b) => new UnixTimeSpan(a.Ticks / (UInt32)b);
2023-03-08 13:17:39 +00:00
public static UInt32 operator /(UnixTimeSpan a, UnixTimeSpan b) => a.Ticks / b.Ticks;
2023-02-16 12:57:06 +00:00
public static UnixTimeSpan operator %(UnixTimeSpan a, UInt32 b) => new UnixTimeSpan(a.Ticks % b);
public static UnixTimeSpan operator %(UnixTimeSpan a, Int32 b) => new UnixTimeSpan(a.Ticks % (UInt32)b);
public static UInt32 operator %(UnixTimeSpan a, UnixTimeSpan b) => a.Ticks % b.Ticks;
}