Return multiple values

From Fōrmulæ wiki
Revision as of 17:28, 23 March 2019 by Admin (Talk | contribs) (Description (from Rosetta Code))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is the answer to the task Return multiple value in the Rosetta Code.

Description (from Rosetta Code)


Show how to return more than one value from a function.


Every function returns one value. The conventional way to return multiple values is to return a list.

In the following example, the function returns the sum and product of two given numbers.