Real constants and functions: Difference between revisions

Content added Content deleted
(added c)
(added haskell)
Line 22: Line 22:


=={{header|C}}==
=={{header|C}}==
Most of the following functions take a double; for each of them there are corresponding ones with "f" or "l" appended to the name that take a float or long double, respectively.
Most of the following functions take a double.
<c>#include <math.h>
<c>#include <math.h>


Line 35: Line 35:
ceil(x); /* ceiling */
ceil(x); /* ceiling */
pow(x,y); /* power */</c>
pow(x,y); /* power */</c>

=={{header|Haskell}}==
<pre>
pi --pi
sqrt x --square root
log x --natural logarithm
exp x --exponential
abs x --absolute value
floor x --floor
ceiling x --ceiling
x ** y --power (floating-point exponentiation)
x ^ y --power (integer exponentiation)
</pre>


=={{header|Java}}==
=={{header|Java}}==