Real constants and functions: Difference between revisions

Content deleted Content added
CalmoSoft (talk | contribs)
No edit summary
Added Elixir
Line 282:
If the result of taking the power of a rational number to another rational number is rational, Bracmat can in many compute it, if needed using prime factorization. See root above. Example:
<code> 243/1024^2/5</code> evaluates to <code>9/16</code>.
 
 
=={{header|C}}==
Line 481 ⟶ 480:
? 10 ** 6
# value: 1000000</lang>
 
=={{header|Elixir}}==
<lang elixir>defmodule Real_constants_and_functions do
def main do
IO.puts :math.exp(1) # e
IO.puts :math.pi # pi
IO.puts :math.sqrt(16) # square root
IO.puts :math.log(10) # natural logarithm
IO.puts :math.log10(10) # base 10 logarithm
IO.puts :math.exp(2) # e raised to the power of x
IO.puts abs(-2.24) # absolute value
IO.puts Float.floor(3.1423) # floor
IO.puts Float.ceil(20.125) # ceiling
IO.puts :math.pow(3,2) # exponentiation
end
end
 
Real_constants_and_functions.main</lang>
 
=={{header|Elm}}==