From 732099fa08b6558ef70a052c4273fa717129de30 Mon Sep 17 00:00:00 2001 From: TillCoyote Date: Tue, 23 Jul 2019 22:28:30 +0600 Subject: [PATCH] math: hypot() --- vlib/math/math.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/math/math.v b/vlib/math/math.v index 0bd03e8974..8a617651f4 100644 --- a/vlib/math/math.v +++ b/vlib/math/math.v @@ -205,6 +205,11 @@ pub fn gcd(a, b i64) i64 { return a } +// Returns hypotenuse of a right triangle. +pub fn hypot(a, b f64) f64 { + return C.hypot(a, b) +} + // lcm calculates least common (non-negative) multiple. pub fn lcm(a, b i64) i64 { if a == 0 {