Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add sub hypot.

  • Loading branch information...
commit f226bf64d4320eccb738a962074bdda4f71b7ba0 1 parent 3d9f4b4
@colomon colomon authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/CORE.setting
View
6 lib/CORE.setting
@@ -3841,6 +3841,12 @@ sub acosech($x) is pure { $x.acosech }
sub cotanh($x) is pure { $x.cotanh }
sub acotanh($x) is pure { $x.acotanh }
sub atan2($y, $x = 1) is pure { $y.atan2($x) }
+sub hypot($a, $b) is pure {
+ my $max = $a.abs max $b.abs;
+ my $min = $a.abs min $b.abs;
+ my $r = $min / $max;
+ $max * sqrt(1 + $r * $r);
+}
sub pick($num, *@values) { @values.pick($num) }
sub roll($num, *@values) { @values.roll($num) }
Please sign in to comment.
Something went wrong with that request. Please try again.