Пример #1
0
        public static Time Sqrt(this SquareTime value)
        {
            var resultUnit  = GlobalUnitRegistry.Relations.GetOrThrow <SquareTimeUnit, TimeUnit>(value.Unit);
            var resultValue = (decimal)Math.Sqrt((double)value.Value);

            return(new Time(resultValue, resultUnit));
        }
Пример #2
0
        public Acceleration ConvertTo(AccelerationUnit newUnit)
        {
            // generator : FractionValuesGenerator.Add_ConvertTo
            if (Unit.Equals(newUnit))
            {
                return(this);
            }
            var a = new Length(Value, Unit.CounterUnit);
            var b = new SquareTime(1, Unit.DenominatorUnit);

            a = a.ConvertTo(newUnit.CounterUnit);
            b = b.ConvertTo(newUnit.DenominatorUnit);
            return(new Acceleration(a.Value / b.Value, newUnit));
        }
Пример #3
0
 public bool Equals(SquareTime other)
 {
     return(Value == other.Value && !(Unit is null) && Unit.Equals(other.Unit));
 }
Пример #4
0
 public int CompareTo(SquareTime other)
 {
     return(UnitedValuesUtils.Compare <SquareTime, SquareTimeUnit>(this, other));
 }