PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Integer
U:RDoc::AnyMethod[iI"[]:ETI"Integer#[];TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I")Returns a slice of bits from +self+.;To:RDoc::Markup::BlankLine o; ; [I"BWith argument +offset+, returns the bit at the given offset, ;TI"8where offset 0 refers to the least significant bit:;T@o:RDoc::Markup::Verbatim; [ I"n = 0b10 # => 2 ;TI"n[0] # => 0 ;TI"n[1] # => 1 ;TI"n[2] # => 0 ;TI"n[3] # => 0 ;T:@format0o; ; [I"QIn principle, <code>n[i]</code> is equivalent to <code>(n >> i) & 1</code>. ;TI".Thus, negative index always returns zero:;T@o;; [I"255[-1] # => 0 ;T; 0o; ; [I"JWith arguments +offset+ and +size+, returns +size+ bits from +self+, ;TI"Fbeginning at +offset+ and including bits of greater significance:;T@o;; [I" n = 0b111000 # => 56 ;TI"*"%010b" % n[0, 10] # => "0000111000" ;TI"*"%010b" % n[4, 10] # => "0000000011" ;T; 0o; ; [I"JWith argument +range+, returns <tt>range.size</tt> bits from +self+, ;TI"Rbeginning at <tt>range.begin</tt> and including bits of greater significance:;T@o;; [I"n = 0b111000 # => 56 ;TI")"%010b" % n[0..9] # => "0000111000" ;TI")"%010b" % n[4..9] # => "0000000011" ;T; 0o; ; [I"<Raises an exception if the slice cannot be constructed.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I"Tself[offset] -> 0 or 1 self[offset, size] -> integer self[range] -> integer ;T0[ I"(*args);T@6FI"Integer;TcRDoc::NormalClass00
[-] chr-i.ri
[edit]
[-] coerce-i.ri
[edit]
[-] to_f-i.ri
[edit]
[-] bit_length-i.ri
[edit]
[-] %2d-i.ri
[edit]
[-] anybits%3f-i.ri
[edit]
[-] integer%3f-i.ri
[edit]
[-] allbits%3f-i.ri
[edit]
[-] upto-i.ri
[edit]
[-] magnitude-i.ri
[edit]
[-] size-i.ri
[edit]
[-] %7c-i.ri
[edit]
[-] try_convert-c.ri
[edit]
[-] %3c%3c-i.ri
[edit]
[-] to_s-i.ri
[edit]
[-] %2a-i.ri
[edit]
[-] %3c%3d-i.ri
[edit]
[-] nobits%3f-i.ri
[edit]
[-] %3c-i.ri
[edit]
[-] numerator-i.ri
[edit]
[-] %3c%3d%3e-i.ri
[edit]
[-] rationalize-i.ri
[edit]
[-] modulo-i.ri
[edit]
[-] remainder-i.ri
[edit]
[-] ceil-i.ri
[edit]
[-] to_r-i.ri
[edit]
[-] sqrt-c.ri
[edit]
[-] cdesc-Integer.ri
[edit]
[-] %2a%2a-i.ri
[edit]
[-] %26-i.ri
[edit]
[-] downto-i.ri
[edit]
[-] %3e-i.ri
[edit]
[-] floor-i.ri
[edit]
[-] divmod-i.ri
[edit]
[-] round-i.ri
[edit]
[-] to_int-i.ri
[edit]
[-] %2d%40-i.ri
[edit]
[-] denominator-i.ri
[edit]
[-] %2f-i.ri
[edit]
[-] abs-i.ri
[edit]
[-] zero%3f-i.ri
[edit]
[-] %3d%3d%3d-i.ri
[edit]
[-] to_bn-i.ri
[edit]
[-] odd%3f-i.ri
[edit]
[-] times-i.ri
[edit]
[-] pred-i.ri
[edit]
[-] %25-i.ri
[edit]
[-] to_i-i.ri
[edit]
[-] %5b%5d-i.ri
[edit]
[-] truncate-i.ri
[edit]
[-] digits-i.ri
[edit]
[-] %3e%3e-i.ri
[edit]
[-] pow-i.ri
[edit]
[+]
..
[-] gcdlcm-i.ri
[edit]
[-] fdiv-i.ri
[edit]
[-] %2b-i.ri
[edit]
[-] %3e%3d-i.ri
[edit]
[-] even%3f-i.ri
[edit]
[-] lcm-i.ri
[edit]
[-] succ-i.ri
[edit]
[-] %3d%3d-i.ri
[edit]
[-] ceildiv-i.ri
[edit]
[-] div-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] %7e-i.ri
[edit]
[-] gcd-i.ri
[edit]
[-] %5e-i.ri
[edit]
[-] ord-i.ri
[edit]
[-] next-i.ri
[edit]