v / vlib / math / sqrt.c.v
16 lines · 13 sloc · 299 bytes · 757929392e0e7a75fc1272116460981e589737d5
Raw
1module math
2
3fn C.sqrt(x f64) f64
4fn C.sqrtf(x f32) f32
5
6// sqrt calculates square-root of the provided value. (float64)
7@[inline]
8pub fn sqrt(a f64) f64 {
9 return C.sqrt(a)
10}
11
12// sqrtf calculates square-root of the provided value. (float32)
13@[inline]
14pub fn sqrtf(a f32) f32 {
15 return C.sqrtf(a)
16}
17