Real constants and functions: Difference between revisions
Content deleted Content added
Add Neko |
|||
Line 1,475: | Line 1,475: | ||
CEILING(x); (* Built in function. *) |
CEILING(x); (* Built in function. *) |
||
Math.pow(x, y);</lang> |
Math.pow(x, y);</lang> |
||
=={{header|Neko}}== |
|||
<lang ActionScript>/** |
|||
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")</lang> |
|||
{{out}} |
|||
<pre>prompt$ nekoc real-contstants.neko |
|||
prompt$ neko real-contstants.n |
|||
Euler : 2.71828182845905 |
|||
Pi : 3.14159265358979 |
|||
Sqrt(2) : 1.4142135623731 |
|||
Log(10) : 2.30258509299405 |
|||
Exp(1) : 2.71828182845905 |
|||
Abs(-2.2) : 2.2 |
|||
Floor(-2.2): -3 |
|||
Ceil(-2.2) : -2 |
|||
Pow(2, 8) : 256</pre> |
|||
=={{header|NetRexx}}== |
=={{header|NetRexx}}== |