⚝
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
/
Prime
/
View File Name :
cdesc-Prime.ri
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[ [U:RDoc::Constant[i I"VERSION;TI"Prime::VERSION;T:public0o;;[ ;@R;0@R@cRDoc::NormalClass0[[I"Enumerable;To;;[ ;@R;0I"lib/prime.rb;T[I"Singleton;To;;[ ;@R;0@a[[I" class;T[[;[ [:protected[ [:private[ [I" instance;T[[;[ [I" each;T@a[I"int_from_prime_division;T@a[I"prime?;T@a[I"prime_division;T@a[;[ [;[ [[I"Forwardable;To;;[ ;@R;0@a[U:RDoc::Context::Section[i 0o;;[ ;0;0[@R@RcRDoc::TopLevel