|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1280 (0x500)
Types: TextFile
Names: »INVERS.PAS«
└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
└─⟦this⟧ »INVERS.PAS«
PROGRAM invers;
VAR
i : INTEGER;
x : REAL;
FUNCTION arcsin(x : REAL) : REAL;
BEGIN
IF ABS(x) < 1
THEN arcsin := ARCTAN(x / SQRT(1 - x * x))
ELSE IF x = 1
THEN arcsin := PI / 2
ELSE IF x = -1
THEN arcsin := -PI / 2;
END;
FUNCTION arccos(x : REAL) : REAL;
BEGIN
IF x = 0
THEN arccos := PI / 2
ELSE IF (0 < x ) AND (x <= 1)
THEN arccos := ARCTAN(SQRT(1 - x * x) / x)
ELSE IF (-1 <= x) AND (x < 0)
THEN arccos := ARCTAN(SQRT(1 - x * x) / x) + PI;
END;
BEGIN (* invers *)
WRITE(CLRHOM);
WRITELN('x' : 4, 'ARCSIN(x)' : 15, 'ARCCOS(x)' : 15);
WRITELN;
FOR i := -10 TO 10 DO
(tekst) <> 8
THEN ok := FALSE
ELSE IF (tekst(.1.) < 'A') OR (tekst(.1.) > 'Å')
THEN ok := FALSE
ELSE IF (tekst(.2.) <> '-') OR (tekst(.5.) <> '-')
THEN ok := FALSE
ELSE
FOR i := 3 TO 8 DO
IF i <> 5