README.md: Add GCD algorithm.

master
peterhinch 2023-05-22 09:57:37 +01:00
rodzic 867fe90a3b
commit 2f5ccec474
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -45,6 +45,7 @@ Please also see the [official examples](https://github.com/micropython/micropyth
4.13 [A Pyboard power meter](./README.md#413-a-pyboard-power-meter) One of my own projects.
4.14 [NTP time](./README.md#414-ntp-time) More portable than official driver with other benefits.
4.15 [Date](./README.md#415-date) Small and simple classes for handling dates.
4.16 [Greatest common divisor](./README.md#416-greatest-common-divisor) Neat algorithm.
5. [Module Index](./README.md#5-module-index) Supported code. Device drivers, GUI's, utilities.
5.1 [uasyncio](./README.md#51-uasyncio) Tutorial and drivers for asynchronous coding.
5.2 [Memory Device Drivers](./README.md#52-memory-device-drivers) Drivers for nonvolatile memory devices.
@ -359,6 +360,16 @@ calendars.
The classes are documented [here](./date/DATE.md)
## 4.16 Greatest Common Divisor
This was found [here](https://github.com/micropython/micropython/pull/8331#issuecomment-1556291482):
```python
def gcd(a, b) :
while b:
a, b = b, a % b
return a
```
##### [Index](./README.md#0-index)
# 5. Module index