FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithm-by-javascript/src/libs/algorithm.ts at master · wenzi0github/algorithm-by-javascript · GitHub
wenzi0github
/
algorithm-by-javascript
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
1
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithm-by-javascript
/
src
/
libs
/
algorithm.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (15 loc) · 256 Bytes
Breadcrumbs
algorithm-by-javascript
/
src
/
libs
/
algorithm.ts
Copy path
File metadata and controls
16 lines (15 loc) · 256 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* 获取两个数的最大公约数
*
@param
{
number
} a
*
@param
{
number
} b
*
@returns
{
number
}
*/
export
const
gcd
=
(
a
:
number
,
b
:
number
)
:
number
=>
{
let
c
=
0
;
while
(
a
%
b
!=
0
)
{
c
=
a
%
b
;
a
=
b
;
b
=
c
;
}
return
c
;
}
;
Back
|
FazBrowse Home
|
New Git URL