⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
Integer
/
View File Name :
%5b%5d-i.ri
U:RDoc::AnyMethod[iI"[]:ETI"Integer#[];TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"=Bit Reference---Returns the <code>n</code>th bit in the ;TI"?binary representation of +int+, where <code>int[0]</code> ;TI""is the least significant bit.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"a = 0b11001100101010 ;TI"$30.downto(0) {|n| print a[n] } ;TI")#=> 0000000000000000011001100101010 ;TI" ;TI"a = 9**15 ;TI"$50.downto(0) {|n| print a[n] } ;TI"=#=> 000101110110100000111000011110010100111100010111001 ;T:@format0o; ; [I"QIn principle, <code>n[i]</code> is equivalent to <code>(n >> i) & 1</code>. ;TI"2Thus, any negative index always returns zero:;T@o;; [I"p 255[-1] #=> 0 ;T; 0o; ; [I"FRange operations <code>n[i, len]</code> and <code>n[i..j]</code> ;TI"are naturally extended.;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"O<code>n[i, len]</code> equals to <code>(n >> i) & ((1 << len) - 1)</code>.;To;;0; [o; ; [I"U<code>n[i..j]</code> equals to <code>(n >> i) & ((1 << (j - i + 1)) - 1)</code>.;To;;0; [o; ; [I"R<code>n[i...j]</code> equals to <code>(n >> i) & ((1 << (j - i)) - 1)</code>.;To;;0; [o; ; [I"9<code>n[i..]</code> equals to <code>(n >> i)</code>.;To;;0; [o; ; [I"w<code>n[..j]</code> is zero if <code>n & ((1 << (j + 1)) - 1)</code> is zero. Otherwise, raises an ArgumentError.;To;;0; [o; ; [I"r<code>n[...j]</code> is zero if <code>n & ((1 << j) - 1)</code> is zero. Otherwise, raises an ArgumentError.;T@o; ; [I"3Note that range operation may exhaust memory. ;TI"MFor example, <code>-1[0, 1000000000000]</code> will raise NoMemoryError.;T: @fileI"numeric.c;T:0@omit_headings_from_table_of_contents_below0I":int[n] -> 0, 1 int[n, m] -> num int[range] -> num ;T0[ I"(*args);T@IFI"Integer;TcRDoc::NormalClass00