(42 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Byte.get_bit 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Byte.get_bit \- check whether a bit is set8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Byte.get_bit\ :\ func(i:\ Byte,\ bit_index:\ Int\ ->\ Bool)13 .fi14 .SH DESCRIPTION15 In the binary representation of a byte, check whether a given bit index is set to 1 or not.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 i Byte The byte whose bits are being inspected.26 bit_index Int The index of the bit to check (1-indexed, range 1-8).27 .TE28 .SH RETURN29 Whether or not the given bit index is set to 1 in the byte.31 .SH NOTES32 The bit index must be between 1-8 or a runtime error will be produced.34 .SH EXAMPLES35 .EX36 assert Byte(6).get_bit(1) == no37 assert Byte(6).get_bit(2) == yes38 assert Byte(6).get_bit(3) == yes39 assert Byte(6).get_bit(4) == no40 .EE41 .SH SEE ALSO42 .BR Tomo-Byte (3)