BryanWilhite / SonghayCore

core reusable, opinionated concerns for *all* 🧐 of my C# projects
http://songhayblog.azurewebsites.net/
MIT License
1 stars 0 forks source link

verify that `Songhay.MathUtility.TruncateNumber` can be replaced by `Math.Truncate` #145

Open BryanWilhite opened 2 years ago

BryanWilhite commented 2 years ago
    /// <summary>
    /// Truncates the number.
    /// </summary>
    /// <param name="x">The x.</param>
    /// <remarks>
    /// Silverlight does not have <c>Math.Truncate()</c>.
    /// </remarks>
    public static double TruncateNumber(double x) => (x < 0 ? -1 : 1) * Math.Floor(Math.Abs(x));