A function is a body of code that returns a value.

The value returned may depend on arguments provided to the function.



Task

Write a definition of a function called "multiply" that takes two arguments and returns their product.

(Argument types should be chosen so as not to distract from showing how functions are created and values returned).



Related task

   Function prototype


/* NetRexx */
options replace format comments java crossref savelog symbols binary
 
pi      = 3.14159265358979323846264338327950
radiusY = 10
in2ft   = 12
ft2yds  = 3
in2mm   = 25.4
mm2m    = 1 / 1000
radiusM = multiply(multiply(radiusY, multiply(multiply(ft2yds, in2ft), in2mm)), mm2m)
 
say "Area of a circle" radiusY "yds radius: " multiply(multiply(radiusY, radiusY), pi).format(3, 3) "sq. yds"
say radiusY "yds =" radiusM.format(3, 3)  "metres"
say "Area of a circle" radiusM.format(3, 3)"m radius:" multiply(multiply(radiusM, radiusM), pi).format(3, 3)"m**2"
 
 
/**
 * Multiplication function
 */
method multiply(multiplicand, multiplier) public static returns Rexx
 
  product = multiplicand * multiplier
  return product