mirror of
https://github.com/vlang/v.git
synced 2025-08-03 09:47:15 -04:00
14 lines
238 B
V
14 lines
238 B
V
module math
|
|
|
|
// square returns the square of the argument x, i.e. x * x
|
|
@[inline]
|
|
pub fn square[T](x T) T {
|
|
return x * x
|
|
}
|
|
|
|
// cube returns the cube of the argument x, i.e. x * x * x
|
|
@[inline]
|
|
pub fn cube[T](x T) T {
|
|
return x * x * x
|
|
}
|