From d51c159160e727797c8f4cf340614e150f9ab2fc Mon Sep 17 00:00:00 2001 From: Nicolas Sauzede Date: Mon, 10 Feb 2020 18:48:44 +0100 Subject: [PATCH] math: add sqrtf --- vlib/math/math.v | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vlib/math/math.v b/vlib/math/math.v index edd29612e4..05ab1b7629 100644 --- a/vlib/math/math.v +++ b/vlib/math/math.v @@ -79,6 +79,9 @@ fn C.sinh(x f64) f64 fn C.sqrt(x f64) f64 +fn C.sqrtf(x f32) f32 + + fn C.tgamma(x f64) f64 @@ -304,6 +307,11 @@ pub fn sqrt(a f64) f64 { return C.sqrt(a) } +// sqrtf calculates square-root of the provided float32 value. +pub fn sqrtf(a f32) f32 { + return C.sqrtf(a) +} + // tan calculates tangent. pub fn tan(a f64) f64 { return C.tan(a)