1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<html>
<head>
<title>EAGLE Help: Rounding Functions</title>
</head>
<body bgcolor=white>
<font face=Helvetica,Arial>
<hr>
<i>EAGLE Help</i>
<h1><center>Rounding Functions</center></h1>
<hr>
<dl>
<dt>
<b>Function</b>
<dd>
Rounding functions.
<p>
<dt>
<b>Syntax</b>
<dd>
<tt>real ceil(real x);</tt><br>
<tt>real floor(real x);</tt><br>
<tt>real frac(real x);</tt><br>
<tt>real round(real x);</tt><br>
<tt>real trunc(real x);</tt>
<p>
<dt>
<b>Returns</b>
<dd>
<tt>ceil </tt> returns the smallest integer not less than <tt>x</tt>.<br>
<tt>floor</tt> returns the largest integer not greater than <tt>x</tt>.<br>
<tt>frac </tt> returns the fractional part of <tt>x</tt>.<br>
<tt>round</tt> returns <tt>x</tt> rounded to the nearest integer.<br>
<tt>trunc</tt> returns the integer part of <tt>x</tt>.
<p>
</dl>
<b>Example</b>
<pre>
real x = 2.567;
printf("The rounded value of %f is %f\n", x, round(x));
</pre>
<hr>
<table width=100% cellspacing=0 border=0><tr><td align=left><font face=Helvetica,Arial>
<a href=index.htm>Index</a>
</font></td><td align=right><font face=Helvetica,Arial size=-1>
<i>Copyright © 2005 CadSoft Computer GmbH</i>
</font></td></tr></table>
<hr>
</font>
</body>
</html>
|