Server IP : 68.65.120.251 / Your IP : 18.216.51.7 [ Web Server : LiteSpeed System : Linux server105.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : travtpib ( 6521) PHP Version : 7.4.33 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cpanel/ea-ruby27/root/usr/lib64/ruby/ruby-2.7.8/mathn/integer/ |
Upload File : |
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