Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/Prime/cdesc-Prime.ri
Arrière
U:RDoc::NormalClass[iI" Prime:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I""The set of all prime numbers.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"Example;T@o:RDoc::Markup::Verbatim;[I" Prime.each(100) do |prime| ;TI"- p prime #=> 2, 3, 5, 7, 11, ...., 97 ;TI" end ;T:@format0o; ;[I"Prime is Enumerable:;T@o;;[I")Prime.first 5 # => [2, 3, 5, 7, 11] ;T;0S;;i; I"Retrieving the instance;T@o; ;[I"OFor convenience, each instance method of +Prime+.instance can be accessed ;TI""as a class method of +Prime+.;T@o; ;[I" e.g.;To;;[I"(Prime.instance.prime?(2) #=> true ;TI"(Prime.prime?(2) #=> true ;T;0S;;i; I"Generators;T@o; ;[ I"JA "generator" provides an implementation of enumerating pseudo-prime ;TI"Knumbers and it remembers the position of enumeration and upper bound. ;TI"KFurthermore, it is an external iterator of prime enumeration which is ;TI"#compatible with an Enumerator.;T@o; ;[I"G+Prime+::+PseudoPrimeGenerator+ is the base class for generators. ;TI"0There are few implementations of generator.;T@o:RDoc::Markup::List: @type: LABEL:@items[o:RDoc::Markup::ListItem:@label[I"%+Prime+::+EratosthenesGenerator+;T;[o; ;[I"Uses eratosthenes' sieve.;To;;[I"&+Prime+::+TrialDivisionGenerator+;T;[o; ;[I"$Uses the trial division method.;To;;[I"+Prime+::+Generator23+;T;[o; ;[ I"OGenerates all positive integers which are not divisible by either 2 or 3. ;TI"DThis sequence is very bad as a pseudo-prime sequence. But this ;TI"His faster and uses much less memory than the other generators. So, ;TI"Fit is suitable for factorizing an integer which is not large but ;TI"4has many prime factors. e.g. for Prime#prime? .;T: @fileI"lib/prime.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [[I"Enumerable;To;;[ ;@R;0I"lib/prime.rb;T[I"Singleton;To;;[ ;@R;0@Z[[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[ [I" each;F@Z[I"int_from_prime_division;F@Z[I"prime?;F@Z[I"prime_division;F@Z[;[ [;[ [[I"Forwardable;To;;[ ;@R;0@Z[U:RDoc::Context::Section[i 0o;;[ ;0;0[@R@RcRDoc::TopLevel
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0 |
proxy
|
phpinfo
|
Réglages