📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 08:51:44
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
Integer
📍 /opt/alt/ruby31/share/ri/system/Integer
🔄 Refresh
✏️
Editing: cdesc-Integer.ri
Read Only
U:RDoc::NormalClass[iI"Integer:ET@I"Numeric;To:RDoc::Markup::Document:@parts[ o;;[ : @fileI"*ext/bigdecimal/lib/bigdecimal/util.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I""ext/openssl/lib/openssl/bn.rb;T; 0o;;[#o:RDoc::Markup::Paragraph;[I"4An \Integer object represents an integer value.;To:RDoc::Markup::BlankLine o;;[I"7You can create an \Integer object explicitly with:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I"PAn {integer literal}[doc/syntax/literals_rdoc.html#label-Integer+Literals].;T@o;;[I"6You can convert certain objects to Integers with:;T@o; ;;;[o;;0;[o;;[I"5\Method {Integer}[Kernel.html#method-i-Integer].;T@o;;[I"GAn attempt to add a singleton method to an instance of this class ;TI"&causes an exception to be raised.;T@S:RDoc::Markup::Heading: leveli: textI"What's Here;T@o;;[I".First, what's elsewhere. \Class \Integer:;T@o; ;;;[o;;0;[o;;[I"SInherits from {class Numeric}[Numeric.html#class-Numeric-label-What-27s+Here].;T@o;;[I"/Here, class \Integer provides methods for:;T@o; ;;;[ o;;0;[o;;[I".{Querying}[#class-Integer-label-Querying];To;;0;[o;;[I"0{Comparing}[#class-Integer-label-Comparing];To;;0;[o;;[I"2{Converting}[#class-Integer-label-Converting];To;;0;[o;;[I"({Other}[#class-Integer-label-Other];T@S;;i;I" Querying;T@o; ;;;[o;;0;[o; ;: NOTE;[o;;[I"#allbits?;T;[o;;[I"0Returns whether all bits in +self+ are set.;To;;0;[o; ;;;[o;;[I"#anybits?;T;[o;;[I"0Returns whether any bits in +self+ are set.;To;;0;[o; ;;;[o;;[I" #nobits?;T;[o;;[I"/Returns whether no bits in +self+ are set.;T@S;;i;I"Comparing;T@o; ;;;[o;;0;[o; ;;;[o;;[I"{<}[#method-i-3C];T;[o;;[I"9Returns whether +self+ is less than the given value.;To;;0;[o; ;;;[o;;[I"{<=}[#method-i-3C-3D];T;[o;;[I")Returns whether +self+ is less than ;TI"!or equal to the given value.;To;;0;[o; ;;;[o;;[I"{<=>}[#method-i-3C-3D-3E];T;[o;;[I">Returns a number indicating whether +self+ is less than, ;TI"/equal to, or greater than the given value.;To;;0;[o; ;;;[o;;[I",{==}[#method-i-3D-3D] (aliased as #===);T;[o;;[I"Returns whether +self+ is ;TI"equal to the given value.;To;;0;[o; ;;;[o;;[I"{>}[#method-i-3E];T;[o;;[I"<Returns whether +self+ is greater than the given value.;To;;0;[o; ;;;[o;;[I"{>=}[#method-i-3E-3D];T;[o;;[I",Returns whether +self+ is greater than ;TI"!or equal to the given value.;T@S;;i;I"Converting;T@o; ;;;["o;;0;[o; ;;;[o;;[I"::sqrt;T;[o;;[I"8Returns the integer square root of the given value.;To;;0;[o; ;;;[o;;[I"::try_convert;T;[o;;[I"6Returns the given value converted to an \Integer.;To;;0;[o; ;;;[o;;[I"#% (aliased as #modulo);T;[o;;[I"+Returns +self+ modulo the given value.;To;;0;[o; ;;;[o;;[I"{&}[#method-i-26];T;[o;;[I";Returns the bitwise AND of +self+ and the given value.;To;;0;[o; ;;;[o;;[I"#*;T;[o;;[I"7Returns the product of +self+ and the given value.;To;;0;[o; ;;;[o;;[I"{**}[#method-i-2A-2A];T;[o;;[I"HReturns the value of +self+ raised to the power of the given value.;To;;0;[o; ;;;[o;;[I"#+;T;[o;;[I"3Returns the sum of +self+ and the given value.;To;;0;[o; ;;;[o;;[I"#-;T;[o;;[I":Returns the difference of +self+ and the given value.;To;;0;[o; ;;;[o;;[I"{/}[#method-i-2F];T;[o;;[I"8Returns the quotient of +self+ and the given value.;To;;0;[o; ;;;[o;;[I"#<<;T;[o;;[I"<Returns the value of +self+ after a leftward bit-shift.;To;;0;[o; ;;;[o;;[I"#>>;T;[o;;[I"=Returns the value of +self+ after a rightward bit-shift.;To;;0;[o; ;;;[o;;[I"#[];T;[o;;[I")Returns a slice of bits from +self+.;To;;0;[o; ;;;[o;;[I"{^}[#method-i-5E];T;[o;;[I"DReturns the bitwise EXCLUSIVE OR of +self+ and the given value.;To;;0;[o; ;;;[o;;[I" #ceil;T;[o;;[I"AReturns the smallest number greater than or equal to +self+.;To;;0;[o; ;;;[o;;[I" #chr;T;[o;;[I";Returns a 1-character string containing the character ;TI"(represented by the value of +self+.;To;;0;[o; ;;;[o;;[I"#digits;T;[o;;[I"EReturns an array of integers representing the base-radix digits ;TI"of +self+.;To;;0;[o; ;;;[o;;[I" #div;T;[o;;[I"FReturns the integer result of dividing +self+ by the given value.;To;;0;[o; ;;;[o;;[I"#divmod;T;[o;;[I"EReturns a 2-element array containing the quotient and remainder ;TI"3results of dividing +self+ by the given value.;To;;0;[o; ;;;[o;;[I" #fdiv;T;[o;;[I"DReturns the Float result of dividing +self+ by the given value.;To;;0;[o; ;;;[o;;[I"#floor;T;[o;;[I"AReturns the greatest number smaller than or equal to +self+.;To;;0;[o; ;;;[o;;[I" #pow;T;[o;;[I"2Returns the modular exponentiation of +self+.;To;;0;[o; ;;;[o;;[I" #pred;T;[o;;[I"/Returns the integer predecessor of +self+.;To;;0;[o; ;;;[o;;[I"#remainder;T;[o;;[I"DReturns the remainder after dividing +self+ by the given value.;To;;0;[o; ;;;[o;;[I"#round;T;[o;;[I"JReturns +self+ rounded to the nearest value with the given precision.;To;;0;[o; ;;;[o;;[I"#succ (aliased as #next);T;[o;;[I"-Returns the integer successor of +self+.;To;;0;[o; ;;;[o;;[I" #to_f;T;[o;;[I")Returns +self+ converted to a Float.;To;;0;[o; ;;;[o;;[I" #to_s (aliased as #inspect);T;[o;;[I"1Returns a string containing the place-value ;TI"1representation of +self+ in the given radix.;To;;0;[o; ;;;[o;;[I"#truncate;T;[o;;[I"5Returns +self+ truncated to the given precision.;To;;0;[o; ;;;[o;;[I"{/}[#method-i-7C];T;[o;;[I":Returns the bitwise OR of +self+ and the given value.;T@S;;i;I" Other;T@o; ;;;[o;;0;[o; ;;;[o;;[I"#downto;T;[o;;[I"?Calls the given block with each integer value from +self+ ;TI"down to the given value.;To;;0;[o; ;;;[o;;[I"#times;T;[o;;[I":Calls the given block +self+ times with each integer ;TI"in <tt>(0..self-1)</tt>.;To;;0;[o; ;;;[o;;[I" #upto;T;[o;;[I"?Calls the given block with each integer value from +self+ ;TI"up to the given value.;T; I"numeric.c;T; 0o;;[ ; I"numeric.rb;T; 0; 0; 0[ [U:RDoc::Constant[i I"GMP_VERSION;TI"Integer::GMP_VERSION;T:public0o;;[o;;[I"The version of loaded GMP.;T@; I" bignum.c;T; 0@<@cRDoc::NormalClass0[ [[I" class;T[[;[ [:protected[ [:private[[I" sqrt;TI"numeric.c;T[I"try_convert;TI"numeric.rb;T[I" instance;T[[;[ [;[ [;[G[I"%;T@K[I"&;T@K[I"*;T@K[I"**;T@K[I"+;T@K[I"-;T@K[I"-@;T@N[I"/;T@K[I"<;T@K[I"<<;T@K[I"<=;T@K[I"<=>;T@K[I"==;T@K[I"===;T@K[I">;T@K[I">=;T@K[I">>;T@K[I"[];T@K[I"^;T@K[I"abs;T@N[I" allbits?;T@K[I" anybits?;T@K[I"bit_length;T@N[I" ceil;T@K[I"chr;T@K[I"coerce;TI" bignum.c;T[I"denominator;TI"rational.c;T[I"digits;T@K[I"div;T@K[I"divmod;T@K[I"downto;T@K[I" even?;T@N[I" fdiv;T@K[I" floor;T@K[I"gcd;T@�[I"gcdlcm;T@�[I"inspect;T@K[I" integer?;T@N[I"lcm;T@�[I"magnitude;T@N[I"modulo;T@K[I" next;T@K[I"nobits?;T@K[I"numerator;T@�[I" odd?;T@N[I"ord;T@N[I"pow;T@K[I" pred;T@K[I"rationalize;T@�[I"remainder;T@K[I" round;T@K[I" size;T@N[I" succ;T@K[I" times;T@K[I" to_bn;TI""ext/openssl/lib/openssl/bn.rb;T[I" to_d;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;T[I" to_f;T@K[I" to_i;T@N[I"to_int;T@N[I" to_r;T@�[I" to_s;T@K[I" truncate;T@K[I" upto;T@K[I" zero?;T@N[I"|;T@K[I"~;T@N[ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[I" bignum.c;TI"*ext/bigdecimal/lib/bigdecimal/util.rb;TI""ext/openssl/lib/openssl/bn.rb;TI"numeric.c;TI"numeric.rb;TI"rational.c;T@0cRDoc::TopLevel
💾 Save Changes
❌ Cancel