Skip to main content

Module word

Module word 

Source
Expand description

Word represents the core integer type we use as the core of Limb, and is typically the same size as a pointer on a particular CPU.

Functionsยง

choice_from_eq ๐Ÿ”’
Returns the truthy value if x == y, and the falsy value otherwise.
choice_from_gt ๐Ÿ”’
Returns the truthy value if x > y, and the falsy value otherwise.
choice_from_le ๐Ÿ”’
Returns the truthy value if x <= y and the falsy value otherwise.
choice_from_lsb ๐Ÿ”’
Returns the truthy value if value == 1, and the falsy value if value == 0.
choice_from_lt ๐Ÿ”’
Returns the truthy value if x < y, and the falsy value otherwise.
choice_from_mask ๐Ÿ”’
Returns the truthy value if value == Word::MAX, and the falsy value if value == 0.
choice_from_msb ๐Ÿ”’
Returns the truthy value if the most significant bit of value is 1, and the falsy value if it equals 0.
choice_from_nz ๐Ÿ”’
Returns the truthy value if value != 0, and the falsy value otherwise.
choice_from_wide_le ๐Ÿ”’
Returns the truthy value if x <= y and the falsy value otherwise.
choice_to_mask ๐Ÿ”’
Create a Word-sized bitmask.
choice_to_wide_mask ๐Ÿ”’
Create a WideWord-sized bitmask.
select ๐Ÿ”’
Return b if self is truthy, otherwise return a.
select_wide ๐Ÿ”’
Return b if self is truthy, otherwise return a.

Type Aliasesยง

WideWord
Wide integer type: double the width of Word.
Word
Unsigned integer type that the Limb newtype wraps.