Real constants and functions: Difference between revisions

Real constants and functions en BASIC256
(Real constants and functions en True BASIC)
(Real constants and functions en BASIC256)
Line 458:
DEF FNceil(n) = INT(n) - (INT(n) <> n)
</lang>
 
=={{header|BASIC256}}==
<lang basic256>e = exp(1) # e not available
print "e = "; e
print "PI = "; PI
 
x = 12.345
y = 1.23
 
print "sqrt = "; sqr(x) # square root
print "ln = "; log(e) # natural logarithm base e
print "log10 = "; log10(e) # base 10 logarithm
print "log = "; log(x)/log(y) # arbitrary base logarithm
print "exp = "; exp(e) # exponential
print "abs = "; abs(-1) # absolute value
print "floor = "; floor(-e) # floor
print "ceil = "; ceil(-e) # ceiling
print "power = "; x ^ y # power</lang>
{{out}}
<pre>e = 2.71828182846
PI = 3.14159265359
sqrt = 3.51354521815
ln = 1.0
log10 = 0.4342944819
log = 12.1404787425
exp = 15.1542622415
abs = 1
floor = -3
ceil = -2
power = 22.0056421324</pre>
 
=={{header|bc}}==
2,130

edits