Server IP : 192.158.238.246 / Your IP : 3.137.159.3 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE 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