//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

static partial class math {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentOutOfRangeException" />
/// <exception cref="OverflowException" />
public static int IntCeiling( double value ) =>
   (int)Math.Ceiling( DoubleValueArg( value ) );

//==================================================================================================

/// <exception cref="ArgumentOutOfRangeException" />
/// <exception cref="OverflowException" />
public static int IntRound( double value ) =>
   (int)Math.Round( DoubleValueArg( value ) );

/// <exception cref="OverflowException" />
public static int IntRound( decimal value ) =>
   (int)Math.Round( value );

//--------------------------------------------------------------------------------------------------

/// <exception cref="ArgumentOutOfRangeException" />
/// <exception cref="OverflowException" />
public static int IntRoundUp( double value ) =>
   (int)u.math.RoundUp( DoubleValueArg( value ) );

/// <exception cref="ArgumentOutOfRangeException" />
/// <exception cref="OverflowException" />
public static int IntRoundDown( double value ) =>
   (int)u.math.RoundDown( DoubleValueArg( value ) );

/// <exception cref="ArgumentOutOfRangeException" />
/// <exception cref="OverflowException" />
public static int IntRoundFromZero( double value ) =>
   (int)u.math.RoundFromZero( DoubleValueArg( value ) );

/// <exception cref="ArgumentOutOfRangeException" />
public static int IntRoundToZero( double value ) =>
   (int)u.math.RoundToZero( DoubleValueArg( value ) );

//--------------------------------------------------------------------------------------------------

/// <exception cref="OverflowException" />
public static int IntRoundUp( decimal value ) =>
   (int)u.math.RoundUp( value );

/// <exception cref="OverflowException" />
public static int IntRoundDown( decimal value ) =>
   (int)u.math.RoundDown( value );

/// <exception cref="OverflowException" />
public static int IntRoundFromZero( decimal value ) =>
   (int)u.math.RoundFromZero( value );

public static int IntRoundToZero( decimal value ) =>
   (int)u.math.RoundToZero( value );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // math

} // user_rtx (.wasm)
