<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>round -- round a number</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_row_spand_spcolumn_spoperations.html">next</a> | <a href="_rotate_lp__Z__Z_cm__Visible__List_rp.html">previous</a> | <a href="_row_spand_spcolumn_spoperations.html">forward</a> | <a href="_rotate_lp__Z__Z_cm__Visible__List_rp.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>round -- round a number</h1> <div class="single"><h2>Description</h2> <div><div><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>round x</tt></div> </dd></dl> </div> </li> <li>Inputs:<ul><li><span><tt>x</tt>, a number</span></li> </ul> </li> <li>Outputs:<ul><li><span>the integer nearest to <tt>x</tt></span></li> </ul> </li> </ul> <table class="examples"><tr><td><pre>i1 : round(-2.3) o1 = -2</pre> </td></tr> <tr><td><pre>i2 : round(-2.3+5*ii) o2 = -2</pre> </td></tr> <tr><td><pre>i3 : round(2/3) o3 = 1</pre> </td></tr> </table> </div> <div><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>round(n,x)</tt></div> </dd></dl> </div> </li> <li>Inputs:<ul><li><span><tt>n</tt>, <span>an <a href="___Z__Z.html">integer</a></span></span></li> <li><span><tt>x</tt>, <span>a <a href="___R__R.html">real number</a></span></span></li> </ul> </li> <li>Outputs:<ul><li><span>the real number with just n decimal digits to the right of the decimal point nearest to <tt>x</tt></span></li> </ul> </li> </ul> <table class="examples"><tr><td><pre>i4 : round(2,1234.5678) o4 = 1234.57 o4 : RR (of precision 53)</pre> </td></tr> <tr><td><pre>i5 : round(-2,1234.5678) o5 = 1200 o5 : RR (of precision 53)</pre> </td></tr> </table> </div> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_floor.html" title="floor function">floor</a> -- floor function</span></li> <li><span><a href="_ceiling.html" title="ceiling function">ceiling</a> -- ceiling function</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>round</tt> :</h2> <ul><li>round(CC)</li> <li>round(QQ)</li> <li>round(RR)</li> <li>round(ZZ)</li> <li>round(ZZ,RR)</li> </ul> </div> </div> </body> </html>