Task

Show how to use the following math constants and functions in your language   (if not available, note it):

   e   (base of the natural logarithm)
   



π


{\displaystyle \pi }


   square root
   logarithm   (any base allowed)
   exponential   (ex )
   absolute value   (a.k.a. "magnitude")
   floor   (largest integer less than or equal to this number--not the same as truncate or int)
   ceiling   (smallest integer not less than this number--not the same as round up)
   power   (xy )


Related task

   Trigonometric Functions


/**
 Real constants and functions, in Neko
 Tectonics:
   nekoc real-constants.neko
   neko real-constants
*/
 
var euler = $loader.loadprim("std@math_exp", 1)(1)
var pi = $loader.loadprim("std@math_pi", 0)()
 
var math_sqrt = $loader.loadprim("std@math_sqrt", 1)
var math_log = $loader.loadprim("std@math_log", 1)
var math_exp = $loader.loadprim("std@math_exp", 1)
var math_abs = $loader.loadprim("std@math_abs", 1)
var math_floor = $loader.loadprim("std@math_floor", 1)
var math_ceil = $loader.loadprim("std@math_ceil", 1)
var math_pow = $loader.loadprim("std@math_pow", 2)
 
$print("Euler      : ", euler, "\n")
$print("Pi         : ", pi, "\n")
 
$print("Sqrt(2)    : ", math_sqrt(2), "\n")
$print("Log(10)    : ", math_log(10), "\n")
$print("Exp(1)     : ", math_pow(euler, 1), "\n")
$print("Abs(-2.2)  : ", math_abs(-2.2), "\n")
$print("Floor(-2.2): ", math_floor(-2.2), "\n")
$print("Ceil(-2.2) : ", math_ceil(-2.2), "\n")
$print("Pow(2, 8)  : ", math_pow(2, 8), "\n")