//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// 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 bitwise {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <summary>
/// Check most significant bit
/// </summary>
public static bool CheckMSBit( int value ) =>
   CheckBit( value, 31 );

/// <summary>
/// Check most significant bit
/// </summary>
public static bool CheckMSBit( long value ) =>
   CheckBit( value, 63 );

/// <summary>
/// Check most significant bit
/// </summary>
public static bool CheckMSBit( short value ) =>
   CheckBit( value, 15 );

/// <summary>
/// Check most significant bit
/// </summary>
public static bool CheckMSBit( byte value ) =>
   CheckBit( value, 7 );

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

/// <summary>
/// Check most significant bit
/// </summary>
[CLSCompliant( false )]
public static bool CheckMSBit( uint value ) =>
   CheckBit( value, 31 );

/// <summary>
/// Check most significant bit
/// </summary>
[CLSCompliant( false )]
public static bool CheckMSBit( ulong value ) =>
   CheckBit( value, 63 );

/// <summary>
/// Check most significant bit
/// </summary>
[CLSCompliant( false )]
public static bool CheckMSBit( ushort value ) =>
   CheckBit( value, 15 );

/// <summary>
/// Check most significant bit
/// </summary>
[CLSCompliant( false )]
public static bool CheckMSBit( sbyte value ) =>
   CheckBit( value, 7 );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // bitwise

} // user_rtx (.wasm)
