我想Degrees
为GPX库创建一个结构。在 GPX 的XSD(GPX 1.1 Schema)degreesType
中定义为 minInclusive = 0 和 maxExclusive = 360。该结构现在应具有两个公共静态字段MinValue = 0
和MaxValue = x
:
public struct Degrees : IFormattable, IComparable, IComparable<Degrees>, IEquatable<Degrees>
{
private decimal value;
public static Degrees MinValue = 0M;
//public static Degrees MaxValue = x;
}
指定 x 值的最佳方法是什么?360D-1 会不准确,360D-0.001 会假设没有人想要比 1/1000 度更好的精度。