UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

In the next example, the program segment displays 1AA33BB667. Note that the fives in X are dropped because no corresponding substitute is provided. X = "122334455667" PRINT CONVERT("245","AB",X) In the following example, Z becomes kakakakaka because the extra character “t” in S2 is ignored: Y="sasasasasa" S1="s" S2="kt" Z=CONVERT(S1,S2,Y) PRINT Z Related Commands UniBasic CONVERT command, SWAP 1-169 UniBasic Commands Reference

COS Syntax COS(expr) Description The UniBasic COS function returns the trigonometric cosine of a numeric expression. Examples In the following example, the program statement assigns the cosine of a 60-degree angle to the variable COSINE. COSINE is assigned the value of 0.5. COSINE = COS(60) In the next example, the program statement prints the cosine of the variable VAL plus 10: PRINT COS(VAL+10) Related Commands ACOS, ASIN, ATAN, COS, SIN, TAN COS 1-170

COS<br />

Syntax<br />

COS(expr)<br />

Description<br />

The <strong>UniBasic</strong> COS function returns the trigonometric cosine of a numeric<br />

expression.<br />

Examples<br />

In the following example, the program statement assigns the cosine of a 60-degree<br />

angle to the variable COSINE. COSINE is assigned the value of 0.5.<br />

COSINE = COS(60)<br />

In the next example, the program statement prints the cosine of the variable VAL plus<br />

10:<br />

PRINT COS(VAL+10)<br />

Related <strong>Commands</strong><br />

ACOS, ASIN, ATAN, COS, SIN, TAN<br />

COS 1-170

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

Saved successfully!

Ooh no, something went wrong!