11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DROUND<br />

Syntax<br />

DROUND(val.expr [,precision.expr])<br />

Description<br />

The <strong>UniBasic</strong> DROUND function performs double-precision rounding on a value.<br />

Double-precision rounding uses two words to store a number, accommodating a<br />

larger number than in single-precision rounding, which stores each number in a<br />

single word.<br />

Note: DROUND affects the internal representation of the numeric value. It performs<br />

the rounding without conversion to and from string variables. This increases the<br />

speed of calculation.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

val.expr Specifies the value to round.<br />

,precision.expr Specifies the precision for the rounding. The valid range is 0 to 14.<br />

Default precision is four places.<br />

DROUND Parameters<br />

Example<br />

In the following example, the DROUND statement results in 18.84955596. The<br />

equation is resolved, and then the result is rounded to eight decimal places.<br />

A= DROUND((3.14159265999*2*3),8)<br />

PRINT A<br />

DROUND 1-222

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!