Skip to content

Commit e168a6d

Browse files
committed
bigint.gcd
1 parent 31f7271 commit e168a6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/Runtime Environment/Bigint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ local bigint = require "pluto:bigint"
9090
print(new bigint(2) ^ new bigint(10)) --> 1024
9191
```
9292

93+
---
94+
### `bigint.gcd`
95+
Computes the greates common divisor shared by 2 bigints.
96+
```pluto
97+
local bigint = require "pluto:bigint"
98+
print(bigint.new(48):gcd(bigint.new(18))) --> 6
99+
```
100+
93101
---
94102
### `bigint.bitlength`
95103
Returns the position of the most significant set bit as a plain integer.

0 commit comments

Comments
 (0)