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

public static int Cleared( int value, int flagsToClear ) =>
   value & ~flagsToClear;

public static long Cleared( long value, long flagsToClear ) =>
   value & ~flagsToClear;

public static short Cleared( short value, short flagsToClear ) =>
   unchecked( (short)( value & ~flagsToClear ) );

public static byte Cleared( byte value, byte flagsToClear ) =>
   unchecked( (byte)( value & ~flagsToClear ) );

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

[CLSCompliant( false )]
public static uint Cleared( uint value, uint flagsToClear ) =>
   value & ~flagsToClear;

[CLSCompliant( false )]
public static ulong Cleared( ulong value, ulong flagsToClear ) =>
   value & ~flagsToClear;

[CLSCompliant( false )]
public static ushort Cleared( ushort value, ushort flagsToClear ) =>
   unchecked( (ushort)( value & ~flagsToClear ) );

[CLSCompliant( false )]
public static sbyte Cleared( sbyte value, sbyte flagsToClear ) =>
   unchecked( (sbyte)( value & ~flagsToClear ) );

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

} // user_rtx (.wasm)
