v / vlib / math / exp.js.v
12 lines · 9 sloc · 193 bytes · 757929392e0e7a75fc1272116460981e589737d5
Raw
1module math
2
3fn JS.Math.exp(x f64) f64
4
5// exp calculates exponent of the number (math.pow(math.E, x)).
6@[inline]
7pub fn exp(x f64) f64 {
8 mut res := 0.0
9 #res.val = Math.exp(x)
10
11 return res
12}
13