blob: 812c4301b9a7db6b7f30994d507a3d48d815e603 [file] [log] [blame]
<html lang="en">
<head>
<title>TIC54X-Builtins - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="TIC54X_002dDependent.html#TIC54X_002dDependent" title="TIC54X-Dependent">
<link rel="prev" href="TIC54X_002dLocals.html#TIC54X_002dLocals" title="TIC54X-Locals">
<link rel="next" href="TIC54X_002dExt.html#TIC54X_002dExt" title="TIC54X-Ext">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
<link rel="stylesheet" type="text/css" href="../cs.css">
</head>
<body>
<div class="node">
<a name="TIC54X-Builtins"></a>
<a name="TIC54X_002dBuiltins"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="TIC54X_002dExt.html#TIC54X_002dExt">TIC54X-Ext</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="TIC54X_002dLocals.html#TIC54X_002dLocals">TIC54X-Locals</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="TIC54X_002dDependent.html#TIC54X_002dDependent">TIC54X-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.36.7 Math Builtins</h4>
<p><a name="index-math-builtins_002c-TIC54X-1679"></a><a name="index-TIC54X-builtin-math-functions-1680"></a><a name="index-builtin-math-functions_002c-TIC54X-1681"></a>
The following built-in functions may be used to generate a
floating-point value. All return a floating-point value except
&lsquo;<samp><span class="samp">$cvi</span></samp>&rsquo;, &lsquo;<samp><span class="samp">$int</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">$sgn</span></samp>&rsquo;, which return an integer
value.
<a name="index-g_t_0040code_007b_0024acos_007d-math-builtin_002c-TIC54X-1682"></a>
<dl><dt><code>$acos(</code><var>expr</var><code>)</code><dd>Returns the floating point arccosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024asin_007d-math-builtin_002c-TIC54X-1683"></a><br><dt><code>$asin(</code><var>expr</var><code>)</code><dd>Returns the floating point arcsine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024atan_007d-math-builtin_002c-TIC54X-1684"></a><br><dt><code>$atan(</code><var>expr</var><code>)</code><dd>Returns the floating point arctangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024atan2_007d-math-builtin_002c-TIC54X-1685"></a><br><dt><code>$atan2(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point arctangent of <var>expr1</var> / <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024ceil_007d-math-builtin_002c-TIC54X-1686"></a><br><dt><code>$ceil(</code><var>expr</var><code>)</code><dd>Returns the smallest integer not less than <var>expr</var> as floating point.
<p><a name="index-g_t_0040code_007b_0024cosh_007d-math-builtin_002c-TIC54X-1687"></a><br><dt><code>$cosh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic cosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024cos_007d-math-builtin_002c-TIC54X-1688"></a><br><dt><code>$cos(</code><var>expr</var><code>)</code><dd>Returns the floating point cosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024cvf_007d-math-builtin_002c-TIC54X-1689"></a><br><dt><code>$cvf(</code><var>expr</var><code>)</code><dd>Returns the integer value <var>expr</var> converted to floating-point.
<p><a name="index-g_t_0040code_007b_0024cvi_007d-math-builtin_002c-TIC54X-1690"></a><br><dt><code>$cvi(</code><var>expr</var><code>)</code><dd>Returns the floating point value <var>expr</var> converted to integer.
<p><a name="index-g_t_0040code_007b_0024exp_007d-math-builtin_002c-TIC54X-1691"></a><br><dt><code>$exp(</code><var>expr</var><code>)</code><dd>Returns the floating point value e ^ <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024fabs_007d-math-builtin_002c-TIC54X-1692"></a><br><dt><code>$fabs(</code><var>expr</var><code>)</code><dd>Returns the floating point absolute value of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024floor_007d-math-builtin_002c-TIC54X-1693"></a><br><dt><code>$floor(</code><var>expr</var><code>)</code><dd>Returns the largest integer that is not greater than <var>expr</var> as
floating point.
<p><a name="index-g_t_0040code_007b_0024fmod_007d-math-builtin_002c-TIC54X-1694"></a><br><dt><code>$fmod(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point remainder of <var>expr1</var> / <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024int_007d-math-builtin_002c-TIC54X-1695"></a><br><dt><code>$int(</code><var>expr</var><code>)</code><dd>Returns 1 if <var>expr</var> evaluates to an integer, zero otherwise.
<p><a name="index-g_t_0040code_007b_0024ldexp_007d-math-builtin_002c-TIC54X-1696"></a><br><dt><code>$ldexp(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point value <var>expr1</var> * 2 ^ <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024log10_007d-math-builtin_002c-TIC54X-1697"></a><br><dt><code>$log10(</code><var>expr</var><code>)</code><dd>Returns the base 10 logarithm of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024log_007d-math-builtin_002c-TIC54X-1698"></a><br><dt><code>$log(</code><var>expr</var><code>)</code><dd>Returns the natural logarithm of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024max_007d-math-builtin_002c-TIC54X-1699"></a><br><dt><code>$max(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point maximum of <var>expr1</var> and <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024min_007d-math-builtin_002c-TIC54X-1700"></a><br><dt><code>$min(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point minimum of <var>expr1</var> and <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024pow_007d-math-builtin_002c-TIC54X-1701"></a><br><dt><code>$pow(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point value <var>expr1</var> ^ <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024round_007d-math-builtin_002c-TIC54X-1702"></a><br><dt><code>$round(</code><var>expr</var><code>)</code><dd>Returns the nearest integer to <var>expr</var> as a floating point number.
<p><a name="index-g_t_0040code_007b_0024sgn_007d-math-builtin_002c-TIC54X-1703"></a><br><dt><code>$sgn(</code><var>expr</var><code>)</code><dd>Returns -1, 0, or 1 based on the sign of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sin_007d-math-builtin_002c-TIC54X-1704"></a><br><dt><code>$sin(</code><var>expr</var><code>)</code><dd>Returns the floating point sine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sinh_007d-math-builtin_002c-TIC54X-1705"></a><br><dt><code>$sinh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic sine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sqrt_007d-math-builtin_002c-TIC54X-1706"></a><br><dt><code>$sqrt(</code><var>expr</var><code>)</code><dd>Returns the floating point square root of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024tan_007d-math-builtin_002c-TIC54X-1707"></a><br><dt><code>$tan(</code><var>expr</var><code>)</code><dd>Returns the floating point tangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024tanh_007d-math-builtin_002c-TIC54X-1708"></a><br><dt><code>$tanh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic tangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024trunc_007d-math-builtin_002c-TIC54X-1709"></a><br><dt><code>$trunc(</code><var>expr</var><code>)</code><dd>Returns the integer value of <var>expr</var> truncated towards zero as
floating point.
</dl>
</body></html>