/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2(TSelf)" /> public static long Log2(long value) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } return(BitOperations.Log2((ulong)value)); }
static int IBinaryNumber <int> .Log2(int value) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } return(BitOperations.Log2((uint)value)); }
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2(TSelf)" /> public static sbyte Log2(sbyte value) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } return((sbyte)BitOperations.Log2((byte)value)); }
/// <inheritdoc cref="IBinaryNumber{TSelf}.Log2(TSelf)" /> public static short Log2(short value) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } return((short)BitOperations.Log2((ushort)value)); }
public static Index FromEnd(int value) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } return(new Index(~value)); }
public Index(int value, bool fromEnd) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } _value = fromEnd ? ~value : value; }
public Index(int value, bool fromEnd = false) { if (value < 0) { ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException(); } if (fromEnd) { _value = ~value; } else { _value = value; } }