Server IP : 66.29.132.122 / Your IP : 3.17.183.204 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cpanel/ea-ruby27/root/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