spagestic commited on
Commit
0fc9213
·
1 Parent(s): a561f92

feat: enhance Gradio interfaces for GCD, prime check, and LCM with detailed descriptions and examples

Browse files
maths/number_theory/gcd.py CHANGED
@@ -13,5 +13,6 @@ gcd_interface = gr.Interface(
13
  inputs=[gr.Number(label="A", precision=0), gr.Number(label="B", precision=0)],
14
  outputs="number",
15
  title="Greatest Common Divisor (GCD)",
16
- description="Compute the greatest common divisor of two integers.",
 
17
  )
 
13
  inputs=[gr.Number(label="A", precision=0), gr.Number(label="B", precision=0)],
14
  outputs="number",
15
  title="Greatest Common Divisor (GCD)",
16
+ 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.",
17
+ examples=[[48, 18], [101, 10], [0, 5], [7, 7]],
18
  )
maths/number_theory/is_prime.py CHANGED
@@ -22,5 +22,6 @@ is_prime_interface = gr.Interface(
22
  inputs=[gr.Number(label="Number", precision=0)],
23
  outputs="text", # Outputting as text to give a clear True/False message
24
  title="Prime Number Check",
25
- description="Check if a number is a prime number.",
 
26
  )
 
22
  inputs=[gr.Number(label="Number", precision=0)],
23
  outputs="text", # Outputting as text to give a clear True/False message
24
  title="Prime Number Check",
25
+ description="Check if a number is a prime number. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.",
26
+ examples=[[2], [17], [18], [1], [0], [97]],
27
  )
maths/number_theory/lcm.py CHANGED
@@ -12,5 +12,6 @@ lcm_interface = gr.Interface(
12
  inputs=[gr.Number(label="A", precision=0), gr.Number(label="B", precision=0)],
13
  outputs="number",
14
  title="Least Common Multiple (LCM)",
15
- description="Compute the least common multiple of two integers."
 
16
  )
 
12
  inputs=[gr.Number(label="A", precision=0), gr.Number(label="B", precision=0)],
13
  outputs="number",
14
  title="Least Common Multiple (LCM)",
15
+ description="Compute the least common multiple (LCM) of two integers. The LCM is the smallest positive integer that is a multiple of both numbers.",
16
+ examples=[[4, 6], [21, 6], [0, 5], [7, 7]],
17
  )