Anonymous user
Real constants and functions: Difference between revisions
→{{header|Groovy}}
Line 180:
Math constants and functions are as outlined in the [[#Java Java]] example, except as follows:
In addition to the java.lang.Math.abs() method, each numeric type has an abs() method, which can be invoked directly on the number:
<lang groovy>println ((-22).abs())</lang>
Line 186:
<pre>22</pre>
In addition to the java.lang.Math.pow() method, each numeric type works with the power operator (**), which can be invoked as an in-fix operator between two numbers:
<lang groovy>println 22**3.5</lang>
Line 197:
<pre>NaN</pre>
Also note that at the moment (
=={{header|Haskell}}==
|