11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SDIV<br />

Syntax<br />

SDIV(x, y)<br />

Description<br />

The <strong>UniBasic</strong> SDIV function divides two string numbers and returns the result as a<br />

string number. SDIV divides x by y. Arguments can be any valid numbers or string<br />

numbers of any magnitude or precision. However, result precision is limited to 14<br />

significant digits.<br />

Tip: Processing string data type numbers rather than numeric data type numbers<br />

degrades processing speed. Numbers specified in quotation marks are string data<br />

type. Numbers specified without quotation marks are numeric data type. The data<br />

type of a variable is determined by the data first loaded into it.<br />

If x or y contains nonnumeric data, UniData displays an error message, and the<br />

operation results in 0. If y is 0, UniData displays an error message that indicates you<br />

cannot divide by 0 and returns a result of 0.<br />

The SDIV function results in a string number, so you can use the function in any<br />

expression in which a string is required. Because the resulting string numbers can be<br />

longer than the arithmetic operator can accommodate, you might not want to use the<br />

SDIV function in expressions requiring numeric data type.<br />

Example<br />

In the following example, the program statement divides the constant (1.4149) by<br />

variable A and assigns the result to variable B:<br />

B = SDIV("1.4149",A)<br />

SDIV 1-701

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

Saved successfully!

Ooh no, something went wrong!