using System; using System.Runtime.CompilerServices; namespace Artemis.Core; /// /// A static class providing extensions /// public static class DoubleExtensions { /// /// Rounds the provided number away to zero and casts the result to an /// /// The number to round /// The rounded number as an integer [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int RoundToInt(this double number) { return (int) Math.Round(number, MidpointRounding.AwayFromZero); } }