v2 / vlib / math / square.v
13 lines · 11 sloc · 238 bytes · 757929392e0e7a75fc1272116460981e589737d5
Raw
1module math
2
3// square returns the square of the argument x, i.e. x * x
4@[inline]
5pub fn square[T](x T) T {
6 return x * x
7}
8
9// cube returns the cube of the argument x, i.e. x * x * x
10@[inline]
11pub fn cube[T](x T) T {
12 return x * x * x
13}
14