REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 689 B
Close
/opt/cpanel/ea-ruby27/root/lib64/ruby/ruby-2.7.8/mathn/integer/prime_division_spec.rb
Text
Base64
require_relative '../../../spec_helper' ruby_version_is ''...'2.5' do require 'mathn' describe "Integer#prime_division" do it "performs a prime factorization of a positive integer" do 100.prime_division.should == [[2, 2], [5, 2]] end # Proper handling of negative integers has been added to MRI trunk # in revision 24091. Prior to that, all versions of MRI returned nonsense. it "performs a prime factorization of a negative integer" do -26.prime_division.should == [[-1, 1], [2, 1], [13, 1]] end it "raises a ZeroDivisionError when is called on zero" do -> { 0.prime_division }.should raise_error(ZeroDivisionError) end end end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
from_prime_division_spec.rb
283 B
lrw-r--r--
2023-04-05 15:24:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
prime_division_spec.rb
689 B
lrw-r--r--
2023-04-05 15:24:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).