Back to Wasmtime

Calculating the GCD

docs/examples-gcd.md

44.0.1710 B
Original Source

Calculating the GCD

You can also browse this source code online and clone the wasmtime repository to run the example locally:

This example shows off how run a wasm program which calculates the GCD of two numbers.

Wasm Source

wat
{{#include ../examples/gcd.wat}}

Host Source

<!-- langtabs-start -->
rust
{{#include ../examples/gcd.rs}}
c
{{#include ../examples/gcd.c}}
cpp
{{#include ../examples/gcd.cc}}
<!-- langtabs-end -->