@@ -4,10 +4,19 @@ Math library of Integer:
44
55PHP-Math-Integer treats the subjects of number theory (only natural number).
66
7+ ## Contents
8+
9+ - [ Requirements] ( #requirements )
10+ - [ Installation] ( #installation )
11+ - [ Usage] ( #usage )
12+ - [ Functions] ( #functions )
13+ - [ Examples] ( #examples )
14+ - [ LICENSE] ( #license )
15+
716## Requirements
817
918- PHP 8.0.0 (CLI) or later
10- - Composer
19+ - [ Composer] ( https://getcomposer.org/ )
1120
1221## Installation
1322
@@ -17,24 +26,100 @@ composer require macocci7/php-math-integer
1726
1827## Usage
1928
29+ See [ Examples] ( #examples ) .
30+
2031## Functions
2132
22- - Number
23- - Prime
24- - Divisor
25- - Multiple
26- - Euclid (Euclidean Algorithm)
27- - Fraction
28- - Bezout (Bezout's Equation)
33+ - Number: treats basic matters of numbers
34+ - isInt(): judges if the param is integer or not
35+ - isIntAll(): judges if all of the param are integer or not
36+ - isNatural(): judges if the param is natural number or not
37+ - isNaturalAll(): judges if all of the param are natural number or not
38+ - isFloat(): judges if the param is float or not
39+ - isFloatAll(): judges if all of the param are float or not
40+ - isNumber(): judges if the param is number or not (different from is_numeric())
41+ - isNumberAll(): judges if all of the param are number or not
42+ - isFraction(): judges if the param is decimal fraction or not
43+ - isFractionAll(): judges if all of the param are fraction or not
44+ - sign(): returns the sign of the param as one of -1, 0 or 1
45+ - int(): returns the integral part of the param
46+ - fraction(): returns the fractional part of the param
47+ - nthDigit(): returns the nth digit of the param
48+ - numberOfDigits(): returns the number of digits of the param
49+ - numberOfFractionalDigits(): returns the number of fractional digits of the param
50+
51+ - Prime: treats matters of primes
52+ - isPrime(): judges if the param is prime or not
53+ - isPrimeAll(): judges if all of the param are prime or not
54+ - next(): returns a prime next to the param
55+ - between(): returns array of primes between the params
56+ - factorize(): factorize the param and returns the process as an array
57+ - factors(): returns the factorized factors of the param as an array
58+ - factorizedFormula(): returns the factorized formula as an array
59+
60+ - Divisor: treats matters of divisors
61+ - count(): returns the number of divisors of the param
62+ - value(): converts the factorized array into an integer and returns it
63+ - formula(): returns the factorized formula as strings
64+ - list(): returns all of divisors of the param as an array
65+ - commonFactors(): returns common factors of the params as an array
66+ - greatestCommonFactor(): returns the greatest common factor of the params
67+ - commonDivisors(): returns all of common divisors of the param as an array
68+ - reduceFraction(): returns reduced fraction consisting of the params as an array
69+
70+ - Multiple: treats matters of multiples
71+ - leastCommonMultiple(): returns the least common multiple of the params
72+
73+ - Euclid (Euclidean Algorithm): treats matters of Euclidean Algorithm
74+ - run(): runs the Euclidean Algorithm and returns the result as an array
75+ - gcd(): returns the greatest common divisor of the params
76+ - isGcdOf(): judges if the first param is gcd of the other params or not
77+ - isCoprime(): judges if the params are coprime or not
78+
79+ - Fraction: treats matters of Fractions
80+ - set(): sets the properties of the fraction specified by the param
81+ - isReduced(): judges if the fraction is reduced or not
82+ - isProper(): judges if the fraction is a proper fraction or not
83+ - isImproper(): judges if the fraction is a improper fraction or not
84+ - isMixed(): judges if the fraction is a mixed fraction or not
85+ - reduce(): reduces the fraction
86+ - toCommonDenominator(): converts the fractions into a common denominator
87+ - add(): adds the param to the fraction
88+ - substruct(): substructs the param from the fraction
89+ - multiply(): multiplies the fraction by the param
90+ - divide(): divide the fraction by the param
91+ - improper(): converts the fraction into a improper fraction
92+ - mixed(): converts the fraction into a mixed fraction
93+ - int(): returns the value of the fraction as an integer
94+ - float(): returns the value of the fraction as an float
95+ - text(): returns the fraction as one-line-text
96+
97+ - Bezout (Bezout's Equation): treats matters of Bezout's Equations
98+ - set(): sets the properties of a Bezout's Equation from the param
99+ - clear(): clears the properties of the Bezout's Equation
100+ - equation(): returns the Bezout's Equation as one-line-text
101+ - isSolvable(): judges if the Bezout's Equation is solvable or not
102+ - solution(): returns a set of solution as an array
103+ - generalSolution(): returns the general solution as an array
104+
105+ ## Examples
106+
107+ - [ UseNumber.php] ( example/UseNumber.php ) results in >> [ UseNumber.txt] ( example/UseNumber.txt )
108+ - [ UsePrime.php] ( example/UsePrime.php ) results in >> [ UsePrime.txt] ( example/UsePrime.txt )
109+ - [ UseDivisor.php] ( example/UseDivisor.php ) results in >> [ UseDivisor.txt] ( example/UseDivisor.txt )
110+ - [ UseMultiple.php] ( example/UseMultiple.php ) results in >> [ UseMultiple.txt] ( example/UseMultiple.txt )
111+ - [ UseFraction.php] ( example/UseFraction.php ) results in >> [ UseFraction.txt] ( example/UseFraction.txt )
112+ - [ UseEuclid.php] ( example/UseEuclid.php ) results in >> [ UseEuclid.txt] ( example/UseEuclid.txt )
113+ - [ UseBezout.php] ( example/UseBezout.php ) results in >> [ UseBezout.txt] ( example/UseBezout.txt )
29114
30- ## License
115+ ## LICENSE
31116
32117[ MIT] ( LICENSE )
33118
34119***
35120
36121* Document Created: 2023/10/19*
37122
38- * Document Updated: 2023/11/04 *
123+ * Document Updated: 2023/11/07 *
39124
40125Copyright 2023 macocci7
0 commit comments