�����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) :  /home/../bin/../lib64/../usr/share/perl5/

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

Current File : /home/../bin/../lib64/../usr/share/perl5/bigrat.pl
package bigrat;
require "bigint.pl";
#
# 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.
#
# Arbitrary size rational math package
#
# by Mark Biggar
#
# Input values to these routines consist of strings of the form 
#   m|^\s*[+-]?[\d\s]+(/[\d\s]+)?$|.
# Examples:
#   "+0/1"                          canonical zero value
#   "3"                             canonical value "+3/1"
#   "   -123/123 123"               canonical value "-1/1001"
#   "123 456/7890"                  canonical value "+20576/1315"
# Output values always include a sign and no leading zeros or
#   white space.
# This package makes use of the bigint package.
# The string 'NaN' is used to represent the result when input arguments 
#   that are not numbers, as well as the result of dividing by zero and
#       the sqrt of a negative number.
# Extreamly naive algorthims are used.
#
# Routines provided are:
#
#   rneg(RAT) return RAT                negation
#   rabs(RAT) return RAT                absolute value
#   rcmp(RAT,RAT) return CODE           compare numbers (undef,<0,=0,>0)
#   radd(RAT,RAT) return RAT            addition
#   rsub(RAT,RAT) return RAT            subtraction
#   rmul(RAT,RAT) return RAT            multiplication
#   rdiv(RAT,RAT) return RAT            division
#   rmod(RAT) return (RAT,RAT)          integer and fractional parts
#   rnorm(RAT) return RAT               normalization
#   rsqrt(RAT, cycles) return RAT       square root

# Convert a number to the canonical string form m|^[+-]\d+/\d+|.
sub main'rnorm { #(string) return rat_num
    local($_) = @_;
    s/\s+//g;
    if (m#^([+-]?\d+)(/(\d*[1-9]0*))?$#) {
	&norm($1, $3 ? $3 : '+1');
    } else {
	'NaN';
    }
}

# Normalize by reducing to lowest terms
sub norm { #(bint, bint) return rat_num
    local($num,$dom) = @_;
    if ($num eq 'NaN') {
	'NaN';
    } elsif ($dom eq 'NaN') {
	'NaN';
    } elsif ($dom =~ /^[+-]?0+$/) {
	'NaN';
    } else {
	local($gcd) = &'bgcd($num,$dom);
	$gcd =~ s/^-/+/;
	if ($gcd ne '+1') { 
	    $num = &'bdiv($num,$gcd);
	    $dom = &'bdiv($dom,$gcd);
	} else {
	    $num = &'bnorm($num);
	    $dom = &'bnorm($dom);
	}
	substr($dom,0,1) = '';
	"$num/$dom";
    }
}

# negation
sub main'rneg { #(rat_num) return rat_num
    local($_) = &'rnorm(@_);
    tr/-+/+-/ if ($_ ne '+0/1');
    $_;
}

# absolute value
sub main'rabs { #(rat_num) return $rat_num
    local($_) = &'rnorm(@_);
    substr($_,0,1) = '+' unless $_ eq 'NaN';
    $_;
}

# multipication
sub main'rmul { #(rat_num, rat_num) return rat_num
    local($xn,$xd) = split('/',&'rnorm($_[0]));
    local($yn,$yd) = split('/',&'rnorm($_[1]));
    &norm(&'bmul($xn,$yn),&'bmul($xd,$yd));
}

# division
sub main'rdiv { #(rat_num, rat_num) return rat_num
    local($xn,$xd) = split('/',&'rnorm($_[0]));
    local($yn,$yd) = split('/',&'rnorm($_[1]));
    &norm(&'bmul($xn,$yd),&'bmul($xd,$yn));
}

# addition
sub main'radd { #(rat_num, rat_num) return rat_num
    local($xn,$xd) = split('/',&'rnorm($_[0]));
    local($yn,$yd) = split('/',&'rnorm($_[1]));
    &norm(&'badd(&'bmul($xn,$yd),&'bmul($yn,$xd)),&'bmul($xd,$yd));
}

# subtraction
sub main'rsub { #(rat_num, rat_num) return rat_num
    local($xn,$xd) = split('/',&'rnorm($_[0]));
    local($yn,$yd) = split('/',&'rnorm($_[1]));
    &norm(&'bsub(&'bmul($xn,$yd),&'bmul($yn,$xd)),&'bmul($xd,$yd));
}

# comparison
sub main'rcmp { #(rat_num, rat_num) return cond_code
    local($xn,$xd) = split('/',&'rnorm($_[0]));
    local($yn,$yd) = split('/',&'rnorm($_[1]));
    &bigint'cmp(&'bmul($xn,$yd),&'bmul($yn,$xd));
}

# int and frac parts
sub main'rmod { #(rat_num) return (rat_num,rat_num)
    local($xn,$xd) = split('/',&'rnorm(@_));
    local($i,$f) = &'bdiv($xn,$xd);
    if (wantarray) {
	("$i/1", "$f/$xd");
    } else {
	"$i/1";
    }   
}

# square root by Newtons method.
#   cycles specifies the number of iterations default: 5
sub main'rsqrt { #(fnum_str[, cycles]) return fnum_str
    local($x, $scale) = (&'rnorm($_[0]), $_[1]);
    if ($x eq 'NaN') {
	'NaN';
    } elsif ($x =~ /^-/) {
	'NaN';
    } else {
	local($gscale, $guess) = (0, '+1/1');
	$scale = 5 if (!$scale);
	while ($gscale++ < $scale) {
	    $guess = &'rmul(&'radd($guess,&'rdiv($x,$guess)),"+1/2");
	}
	"$guess";          # quotes necessary due to perl bug
    }
}

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