Пример #1
0
        internal static float Round(float value, RoundingVariant variant)
        {
            switch (variant.Style)
            {
            case Rounding.None:
                return(value);

            case Rounding.Round:
                return(Compute.RoundValue(value, variant.Precision));

            case Rounding.Floor:
                return(Compute.FloorValue(value, variant.Precision));

            case Rounding.Ceil:
                return(Compute.CeilValue(value, variant.Precision));
            }

            throw new NotImplementedException();
        }