Spaces:
Runtime error
Runtime error
import gradio as gr | |
def gcd(a: int, b: int) -> int: | |
"""Compute the greatest common divisor of two integers.""" | |
while b: | |
a, b = b, a % b | |
return abs(a) | |
gcd_interface = gr.Interface( | |
fn=gcd, | |
inputs=[gr.Number(label="A", precision=0), gr.Number(label="B", precision=0)], | |
outputs="number", | |
title="Greatest Common Divisor (GCD)", | |
description="Compute the greatest common divisor (GCD) of two integers using the Euclidean algorithm. The GCD is the largest integer that divides both numbers without leaving a remainder.", | |
examples=[[48, 18], [101, 10], [0, 5], [7, 7]], | |
) | |