Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,44 @@
|
|||
INCLUDE "D2:REAL.ACT" ;from the Action! Tool Kit
|
||||
|
||||
BYTE FUNC Equal(REAL POINTER a,b)
|
||||
BYTE ARRAY x,y
|
||||
|
||||
x=a y=b
|
||||
IF x(0)=y(0) AND x(1)=y(1) AND x(2)=y(2) THEN
|
||||
RETURN (1)
|
||||
FI
|
||||
RETURN (0)
|
||||
|
||||
PROC Sqrt(REAL POINTER a,b)
|
||||
REAL z,half
|
||||
|
||||
IntToReal(0,z)
|
||||
ValR("0.5",half)
|
||||
|
||||
IF Equal(a,z) THEN
|
||||
RealAssign(z,b)
|
||||
ELSE
|
||||
Power(a,half,b)
|
||||
FI
|
||||
RETURN
|
||||
|
||||
PROC Main()
|
||||
BYTE i
|
||||
REAL x,x2,sum,tmp
|
||||
|
||||
IntToReal(0,sum)
|
||||
FOR i=1 TO 10
|
||||
DO
|
||||
IntToReal(i,x)
|
||||
RealMult(x,x,x2)
|
||||
RealAdd(sum,x2,tmp)
|
||||
RealAssign(tmp,sum)
|
||||
OD
|
||||
IntToReal(10,x)
|
||||
RealDiv(sum,x,tmp)
|
||||
Sqrt(tmp,x)
|
||||
|
||||
Put(125) PutE() ;clear screen
|
||||
Print("RMS of 1..10 is ")
|
||||
PrintRE(x)
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue