Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -1,8 +1,7 @@
|
|||
use v6;
|
||||
# Author: P. Seebauer
|
||||
sub the_function(Range $a, Range $b, $s ) {
|
||||
my ($a1, $a2, $b1, $b2) = ($a, $b)».bounds;
|
||||
sub the_function(Range $a, Range $b, $s) {
|
||||
my ($a1, $a2) = $a.bounds;
|
||||
my ($b1, $b2) = $b.bounds;
|
||||
return $b1 + (($s-$a1) * ($b2-$b1) / ($a2-$a1));
|
||||
}
|
||||
|
||||
for ^11 -> $x {say "$x maps to {the_function(0..10,-1..0, $x)}"}
|
||||
for ^11 -> $x { say "$x maps to {the_function(0..10, -1..0, $x)}" }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
sub getmapper(Range $a, Range $b) {
|
||||
my ($a1, $a2, $b1, $b2) = ($a, $b)».bounds;
|
||||
my ($a1, $a2) = $a.bounds;
|
||||
my ($b1, $b2) = $b.bounds;
|
||||
return -> $s { $b1 + (($s-$a1) * ($b2-$b1) / ($a2-$a1)) }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue