Real constants and functions: Difference between revisions
Content added Content deleted
m (RPL: add section) |
|||
Line 1,107: | Line 1,107: | ||
EasyLang does not have ''e'', exponential, or a ceiling function. |
EasyLang does not have ''e'', exponential, or a ceiling function. |
||
<syntaxhighlight lang="easylang"> |
<syntaxhighlight lang="easylang"> |
||
x = 1.5 |
|||
pi # Pi |
|||
# calculate e |
|||
sqrt x # Square root |
|||
e = pow 3 (1 / logn 3) |
|||
numfmt 4 0 |
|||
abs x # Absolute value |
|||
# e |
|||
floor x # Floor |
|||
print e |
|||
pow x y # Power |
|||
# square root |
|||
print sqrt x |
|||
# natural logarithm |
|||
print logn x |
|||
# exponential |
|||
print pow e x |
|||
# absolute value |
|||
print abs x |
|||
# floor |
|||
print floor x |
|||
# ceiling |
|||
if x > floor x |
|||
print floor x + 1 |
|||
else |
|||
print x |
|||
end |
|||
# power |
|||
print pow 2 x |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||