Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $range= (1.0 .. 9.9)
- my $val=15.3;
- my $clamped=$range.clamp($val);
- # $clamped would be 9.9
- $val= -1.3;
- $clamped=$range.clamp($val);
- # $clamped would be 1.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement