307ARITHMETIC FUNCTIONS

STATEMENT SYNTAX/FUNCTION

ABS

ABS (expression)

 

Gives the absolute value of the expression

X.ABS returns X if X>=0, -X otherwise.

STATEMENT SYNTAX/FUNCTION

ATN

ATN (expression)

 

Gives the arcTangent of the expression X.

 

The result is returned in radians and ranges

 

from -PI/2 to PI/2 (PI/2=1.5708). If you

 

want to use this function, you must provide

 

the code in memory. See Appendix H for

 

implementation details.

STATEMENT

SYNTAX/FUNCTION

COS

COS (expression)

 

Gives the cosine of the expression X. X is

 

interpreted as being in radians.

STATEMENT

SYNTAX/FUNCTION

EXP

EXP (expression)

 

Gives the constant "E" (2.71828) raised so

 

the power X (E^X). The maximum argu-

 

ment that can be passed to EXP without

 

overflow occurring is 88.0296.

STATEMENT

SYNTAX/FUNCTION

INT

INT (expression)

 

Returns the largest integer less than or

 

equal to its expression X. For example:

 

INT(.23)=0, INT(7)=7, INT(-.1)=-1,

 

INT(-2)=-2, INT(1.1)=1.

 

The following would round X to 0 decimal

 

places:

 

INT(X*10^D+.5)/10^D

STATEMENT

SYNTAX/FUNCTION

LOG

LOG (expression)

 

Gives the natural (Base E) logarithm of its

 

expression X. To obtain the Base Y

 

logarithm of X use the formula LOG(X)/

 

LOG(Y). Example: The base 10 (com-

 

mon) log of 7 = LOG(7)/LOG(10).

STATEMENT

SYNTAX/FUNCTION

RND

RND (parameter)

 

Generates a random number between 0

 

and 1. The parameter X controls the

 

generation of random numbers as follows:

 

X<0 starts a new sequence of random

 

numbers using X. Calling RND with the

 

same X starts the same random number

 

sequence. X=0 gives the last random

 

number generated. Repeated calls to

 

RND(0) will always return the same

 

random number. X>0 generates a new

 

random number between 0 and 1.

EXAMPLE

120 PRINT ABS(X)

EXAMPLE

210 PRINT ATN(X)

EXAMPLE

200 PRINT COS(X)

EXAMPLE

150 PRINT EXP(X)

EXAMPLE

140 PRINT INT(X)

EXAMPLE

160 PRINT LOG(X)

EXAMPLE

170 PRINT RND(X)

Page 246
Image 246
Apple II Arithmetic Functions Statement SYNTAX/FUNCTION ABS, Statement SYNTAX/FUNCTION ATN, Statement SYNTAX/FUNCTION COS

II specifications

The Apple II, launched in April 1977, was one of the first highly successful mass-produced microcomputer products. It marked a significant leap in personal computing, setting standards for future developments in the industry. Created by Steve Wozniak and Steve Jobs, the Apple II differentiated itself with its user-friendly design, appealing aesthetics, and robust capabilities.

One of the standout features of the Apple II was its open architecture, which allowed users to expand and enhance the computer's functionality. This design enabled hundreds of third-party hardware and software developers to contribute to its ecosystem, resulting in an array of peripherals, including printers, modems, and storage devices. The Apple II utilized a MOS Technology 6502 microprocessor running at a clock speed of 1 MHz. Initially equipped with 4 KB of RAM, the machine could be expanded to 48 KB, accommodating more complex applications and programs.

The Apple II was also notable for its colorful graphics. It was one of the first computers to support color display, offering a 6-color palette with a resolution of 280x192 pixels in 16 colors when using its Color Graphics Card. This feature significantly enhanced the visual appeal of games and educational software developed for the platform, making computing more accessible and entertaining for various audiences.

Apple's commitment to user experience was evident in the design of the machine. It featured an integrated keyboard and a plastic case, which was both durable and visually appealing. The self-contained design included drive bays for floppy disk drives, allowing for quicker data access than traditional tape drives. It also supported audio output, enabling sound effects and music, a novelty at the time.

The introduction of the Apple DOS operating system further underscored the machine's capabilities. DOS streamlined file management and made it easier for users to navigate and manage their data. The combination of hardware and software positioned the Apple II as an educational tool and a gaming platform, fostering a vibrant software ecosystem.

The Apple II family continued to evolve, with variations like the Apple II+, IIe, and IIgs being introduced over the years. These iterations brought enhancements in memory, processing power, and graphics capabilities. The legacy of the Apple II endures, not only as a foundational product in personal computing but also as a symbol of innovation that paved the way for future advancements in technology. Its impact is still felt today, as it inspired countless developers and shaped the trajectory of the computer industry.