> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/f/first-class_functions/use_numbers_analogously.md).

# Use numbers analogously

```perl
sub multiplied ($g, $f) { return { $g * $f * $^x } }
 
my $x  = 2.0;
my $xi = 0.5;
my $y  = 4.0;
my $yi = 0.25;
my $z  = $x + $y;
my $zi = 1.0 / ( $x + $y );

my @numbers = $x, $y, $z;
my @inverses = $xi, $yi, $zi;
 
for flat @numbers Z @inverses { say multiplied($^g, $^f)(.5) }
```

Output:

```
0.5
0.5
0.5
```

The structure of this is identical to first-class function task.
