Skip to content

UInt16Extensions Class

Definition

Extension methods for UInt16 (UInt16) values.

public static class UInt16Extensions

View source

Methods

Name Description
DidAdditionHalfCarry(UInt16, UInt16, UInt16) Determines whether an addition produced a half carry, i.e. a carry from bit 11 to bit 12.
DidAdditionOverflow(UInt16, UInt16, UInt16) Determines whether a signed addition overflowed by examining the sum and its operands.
DidSubtractionHalfBorrow(UInt16, UInt16, UInt16) Determines whether a subtraction produced a half borrow, i.e. a borrow from bit 12 to bit 11.
DidSubtractionOverflow(UInt16, UInt16, UInt16) Determines whether a signed subtraction overflowed by examining the difference and its operands.
GetBit(UInt16, Int32) Gets the value of the bit at the specified index.
LeastSignificantByte(UInt16) Gets the least significant byte of a UInt16.
LeftMostBit(UInt16) Gets the left-most bit (bit 15) of a UInt16.
MostSignificantByte(UInt16) Gets the most significant byte of a UInt16.
ResetBit(UInt16, Int32) Returns a new UInt16 with the bit at the specified index cleared.
RightMostBit(UInt16) Gets the right-most bit (bit 0) of a UInt16.
SetBit(UInt16, Int32) Returns a new UInt16 with the bit at the specified index set.
SignBit(UInt16) Gets the sign bit (bit 15) of a UInt16.
ToBinaryString(UInt16) Converts a UInt16 to its binary string representation, e.g. "0b0001001000110100".
ToBytes(UInt16) Decomposes a UInt16 into its most and least significant bytes.