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.

NEG<br />

Syntax<br />

NEG(expr)<br />

Description<br />

The <strong>UniBasic</strong> NEG function changes the value of expr to its opposite sign. If the<br />

value of expr is positive, NEG returns a negative value. If the value of expr is<br />

negative, NEG returns a positive value.<br />

Example<br />

In the following example, the program segment changes the value of variable A to a<br />

negative number and prints -1:<br />

A = 1<br />

A = NEG(A)<br />

PRINT A<br />

Related Command<br />

<strong>UniBasic</strong><br />

ABS<br />

1-476 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!